Skip to content

Instantly share code, notes, and snippets.

@YuerLee
Created March 1, 2017 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save YuerLee/2d062e58894d45039ad06359e08f7002 to your computer and use it in GitHub Desktop.
Save YuerLee/2d062e58894d45039ad06359e08f7002 to your computer and use it in GitHub Desktop.
Test Webduino Smart
'use strict';
var webduino = require('webduino-js');
var board = new webduino.Arduino({
transport: 'websocket',
url: '192.168.1.236'
});
board.on(webduino.BoardEvent.READY, function () {
console.log('board ready');
});
board.on(webduino.BoardEvent.ERROR, function (err) {
console.log('board error', err.message);
});
board.on(webduino.BoardEvent.BEFOREDISCONNECT, function () {
console.log('board beforedisconnect');
});
board.on(webduino.BoardEvent.DISCONNECT, function () {
console.log('board disconnect');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment