arduino-firmata
Advanced tools
Comparing version 0.2.1 to 0.3.0
@@ -0,1 +1,5 @@ | ||
=== 0.3.0 2014-01-31 | ||
* add supported boards Arduino diecimila, duemillanove and seeduino #4 | ||
=== 0.2.1 2014-01-29 | ||
@@ -2,0 +6,0 @@ |
@@ -89,2 +89,6 @@ (function() { | ||
ArduinoFirmata.prototype.isOldArduinoDevice = function() { | ||
return /usbserial|USB/.test(this.serialport_name); | ||
}; | ||
ArduinoFirmata.prototype.connect = function(serialport_name, opts) { | ||
@@ -105,12 +109,19 @@ var _this = this; | ||
} | ||
this.once('connect', function() { | ||
var i, _i, _j, _results; | ||
for (i = _i = 0; _i < 6; i = ++_i) { | ||
this.write([ArduinoFirmata.REPORT_ANALOG | i, 1]); | ||
} | ||
_results = []; | ||
for (i = _j = 0; _j < 2; i = ++_j) { | ||
_results.push(this.write([ArduinoFirmata.REPORT_DIGITAL | i, 1])); | ||
} | ||
return _results; | ||
this.once('boardReady', function() { | ||
var io_init_wait, | ||
_this = this; | ||
debug('boardReady'); | ||
io_init_wait = this.isOldArduinoDevice() ? (debug("old arduino device found " + this.serialport_name), 3000) : (debug("new arduino device found " + this.serialport_name), 100); | ||
debug("wait " + io_init_wait + "(msec)"); | ||
return setTimeout(function() { | ||
var i, _i, _j; | ||
for (i = _i = 0; _i < 6; i = ++_i) { | ||
_this.write([ArduinoFirmata.REPORT_ANALOG | i, 1]); | ||
} | ||
for (i = _j = 0; _j < 2; i = ++_j) { | ||
_this.write([ArduinoFirmata.REPORT_DIGITAL | i, 1]); | ||
} | ||
debug('init IO ports'); | ||
return _this.emit('connect'); | ||
}, io_init_wait); | ||
}); | ||
@@ -127,3 +138,3 @@ this.serialport = new SerialPort(this.serialport_name, opts); | ||
_this.status = ArduinoFirmata.Status.OPEN; | ||
return _this.emit('connect'); | ||
return _this.emit('boardReady'); | ||
}); | ||
@@ -202,4 +213,3 @@ return _this.serialport.on('data', function(data) { | ||
ArduinoFirmata.prototype.servoWrite = function(pin, angle, callback) { | ||
var _this = this; | ||
this.pinMode(pin, ArduinoFirmata.SERVO, function(err, res) {}); | ||
this.pinMode(pin, ArduinoFirmata.SERVO); | ||
return this.write([ArduinoFirmata.ANALOG_MESSAGE | (pin & 0x0F), angle & 0x7F, angle >>> 7], callback); | ||
@@ -206,0 +216,0 @@ }; |
{ | ||
"name": "arduino-firmata", | ||
"private": false, | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"description": "Arduino Firmata implementation for Node.js", | ||
@@ -6,0 +6,0 @@ "main": "lib/arduino-firmata.js", |
@@ -22,3 +22,9 @@ arduino-firmata | ||
* Arduino (http://arduino.cc) | ||
* testing with Arduino UNO, Leonardo and Micro. | ||
* testing with | ||
* Arduino Diecimila | ||
* Arduino Duemillanove | ||
* Arduino UNO | ||
* Arduino Leonardo | ||
* Arduino Micro | ||
* Seeduino v2 | ||
* Arduino Standard Firmata v2.2 | ||
@@ -25,0 +31,0 @@ * Arduino IDE -> [File] -> [Examples] -> [Firmata] -> [StandardFirmata] |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
165365
735
160