Created
March 1, 2017 13:41
-
-
Save YuerLee/2d062e58894d45039ad06359e08f7002 to your computer and use it in GitHub Desktop.
Test Webduino Smart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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