bugfixing some typos
This commit is contained in:
parent
fac756b226
commit
8b7b84f83a
1 changed files with 4 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
||||||
var events = require('events'),
|
var events = require('events'),
|
||||||
child = require('child_process'),
|
child = require('child_process'),
|
||||||
util = require('util'),
|
util = require('util'),
|
||||||
serial = require("serialport").SerialPort;
|
serial = require("serialport");
|
||||||
|
|
||||||
var Arduino = function (baudrate) {
|
var Arduino = function (baudrate) {
|
||||||
this.baudrate = baudrate && baudrate || 9600;
|
this.baudrate = baudrate && baudrate || 9600;
|
||||||
|
@ -19,7 +19,7 @@ Arduino.prototype.setup = function () {
|
||||||
buff = buff.slice(0, buff.indexOf('\n'));
|
buff = buff.slice(0, buff.indexOf('\n'));
|
||||||
console.log('Guessing serial port ... ' + buff);
|
console.log('Guessing serial port ... ' + buff);
|
||||||
|
|
||||||
self.serial = new serial(buff, {
|
self.serial = new serial.SerialPort(buff, {
|
||||||
baudrate: self.baudrate,
|
baudrate: self.baudrate,
|
||||||
parser: serial.parsers.readline('\n')
|
parser: serial.parsers.readline('\n')
|
||||||
}, false);
|
}, false);
|
||||||
|
@ -30,7 +30,7 @@ Arduino.prototype.setup = function () {
|
||||||
return self.success = false;
|
return self.success = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
serialPort.write(new Buffer('00000000'));
|
self.serial.write(new Buffer('00000000'));
|
||||||
});
|
});
|
||||||
|
|
||||||
self.success = true;
|
self.success = true;
|
||||||
|
@ -53,4 +53,4 @@ Arduino.prototype.processWriteBuffer = function () {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Arduino;
|
module.exports = Arduino;
|
||||||
|
|
Reference in a new issue