/webduino-js

⚙️ The Webduino Javascript Core, for Browser and Node.js

Primary LanguageJavaScriptMIT LicenseMIT

webduino-js

The Webduino Javascript Core, for Browser and Node.js

Installation

Browser

Using bower:

$ bower install webduino-js#dist

Insert scripts:

<script src="bower_components/webduino-js/dist/webduino-base.js"></script>
<script src="bower_components/webduino-js/src/module/Led.js"></script>
... (modules used)

Or all-in-one:

<script src="bower_components/webduino-js/dist/webduino-all.js"></script>

Node.js

$ npm install webduino-js

Usage

webduino-js provides isomorphic APIs:

var webduino = require('webduino-js');

var board, led;

board = new webduino.WebArduino('device_id');

board.on('ready', function() {
  led = new webduino.module.Led(board, board.getDigitalPin(10));
  led.on();
});

Transports

webduino-js talks to Webduino Dev Board via MQTT by default. However, since webduino-js speaks Firmata, we can also directly talk to standard Arduino or any dev board that understands firmata.

Currently we have transports supporting USB serial port and Bluetooth (HC-06 tested) communications: (Note: you have to install Firmata library first)

See Also

License

This project is licensed under MIT license, see LICENSE for more information.