File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ var arduino = require ( '../' ) ;
2+
3+ var board = new arduino . Board ( {
4+ debug : true ,
5+ baudrate : 9600
6+ } ) ;
7+
8+ var led = new arduino . Led ( {
9+ board : board ,
10+ pin : 9
11+ } ) ;
12+
13+ board . on ( 'ready' , function ( ) {
14+ led . blink ( ) ;
15+ } ) ;
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ var events = require('events'),
1212var Board = function ( options ) {
1313 this . log ( 'info' , 'initializing' ) ;
1414 this . debug = options && options . debug || false ;
15+ this . baudrate = options && options . baudrate || 115200 ;
1516 this . writeBuffer = [ ] ;
1617
1718 var self = this ;
@@ -83,7 +84,7 @@ Board.prototype.detect = function (callback) {
8384 if ( possible . slice ( 0 , 2 ) !== 'cu' ) {
8485 try {
8586 temp = new serial . SerialPort ( '/dev/' + possible , {
86- baudrate : 115200 ,
87+ baudrate : self . baudrate ,
8788 parser : serial . parsers . readline ( '\n' )
8889 } ) ;
8990 } catch ( e ) {
You can’t perform that action at this time.
0 commit comments