obniz-ir-unit

1.0.0 • Public • Published

obniz-ir-unit

obnizM5Stack用赤外線送受信ユニットを操作するためのライブラリです。

// イメージ

インストール

$ npm install obniz-ir-unit

サンプルコード

import Obniz from 'obniz';
import IrUnit from 'obniz-ir-unit';

const obniz = new Obniz('OBNIZ_ID_HERE');
const pin = {
  in: 0,
  out: 1,
  vcc: 2,
  gnd: 3,
};

obniz.onconnect = async () => {
  const irUnit = new IrUnit(obniz, pin);

  irUnit.send([1, 1, 1, 0, 0, 0]);
  await obniz.wait(1000);

  obniz.close();
}

Readme

Keywords

Package Sidebar

Install

npm i obniz-ir-unit

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

12.3 kB

Total Files

7

Last publish

Collaborators

  • tmitsuoka0423