You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An extendable implementation of Johnny Five's IO Plugins.
Implements all required and optional methods, along with the required constants - MODE, HIGH, LOW, etc.
You should configure the relevant pins of your board in your constructor, then emit the ready event.
E.g.:
varutil=require('util'),BoardIO=require('board-io');MyIO=function(path,callback){// call super constructorBoardIO.call(this);// .. configure pinsthis._pins.push(..);// wait for an async method or use proccess.nextTick to// signal eventsprocess.nextTick(function(){// connect to hardware and emit "connect" eventthis.emit("connect");// all done, emit ready eventthis.emit("ready");// finally call the passed callbackcallback();}.bind(this));}util.inherits(IO,BoardIO);
Finally implement any of the IO Plugin methods of your choosing:
By default BoardIO will print a message when every non-implemented method is invoked. To prevent this, set the quiet property of the super constructor args to true:
MyIO=function(path,callback){// call super constructorBoardIO.call(this,{..quiet: true});..}util.inherits(IO,BoardIO);
Changelog
3.0.5
Add serial methods and constants to match firmata
3.0.4
Actually just configurable
3.0.3
Make properties configurable and writable
3.0.2
Define pins and analogPins on initialisation
3.0.1
Adds new i2cXXX methods
Prints deprecation warning when calling old sendI2CXXX methods
3.0.0 - Initial release
All Firmata methods stubbed out
About
Allows for boards other than Arduinos loaded with Firmata to be used with johnny-five