0.0.2 • Published 6 years ago
twelite-sdk v0.0.2
TWELITE SDK for JavaScript
This project is UNOFFICIAL SDK of TWELITE.
What is TWELITE?
https://mono-wireless.com/jp/index.html
Getting Started
Install
$ npm install --save twelite-sdk
// or
$ yarn add twelite-sdk
Build
This SDK depends on node-serialport. In some cases, the module requires a preparation to work well. See serialport#installation-special-cases
Usage
import {Twelite, ChangeOutputCommand} from 'twelite-sdk';
// You can import with ES6 module style if you use anu bundler, TypeScript and so on.
// import {Twelite, ChangeOutputCommand} from 'twelite-sdk';
Twelite.list()
.serialPorts(([port])=>{
const twelite = new Twelite(port.comName);
twelite.open()
.then(()=>{
const command = new ChangeOutputCommand();
command.digital = [0, -1, -1, -1];
twelite.write(command);
})
});