arduino-firmata
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -0,4 +1,9 @@ | ||
=== 0.0.5 2014-01-27 | ||
* performance improvement (write bytes at once) | ||
* add socket.io sample #7 | ||
=== 0.0.4 2014-01-27 | ||
* add tests | ||
* add tests #3 | ||
* bugfix digitalRead() | ||
@@ -8,3 +13,3 @@ | ||
* fix coffee-script | ||
* fix coffee-script #2 | ||
* thank you for contributing @geta6 | ||
@@ -14,3 +19,4 @@ | ||
* use SerialPort.list() instead of fs.readdir() | ||
* use SerialPort.list() instead of fs.readdir() #1 | ||
* thank you for suggestion @rwaldron | ||
@@ -17,0 +23,0 @@ === 0.0.1 2014-01-26 |
@@ -107,9 +107,7 @@ (function() { | ||
for (i = _i = 0; _i < 6; i = ++_i) { | ||
this.write(ArduinoFirmata.REPORT_ANALOG | i); | ||
this.write(1); | ||
this.write([ArduinoFirmata.REPORT_ANALOG | i, 1]); | ||
} | ||
_results = []; | ||
for (i = _j = 0; _j < 2; i = ++_j) { | ||
this.write(ArduinoFirmata.REPORT_DIGITAL | i); | ||
_results.push(this.write(1)); | ||
_results.push(this.write([ArduinoFirmata.REPORT_DIGITAL | i, 1])); | ||
} | ||
@@ -123,3 +121,3 @@ return _results; | ||
debug('request REPORT_VERSION'); | ||
return _this.write(ArduinoFirmata.REPORT_VERSION); | ||
return _this.write([ArduinoFirmata.REPORT_VERSION]); | ||
}, 500); | ||
@@ -153,9 +151,7 @@ _this.once('boardVersion', function(version) { | ||
ArduinoFirmata.prototype.write = function(byte) { | ||
return this.serialport.write([byte]); | ||
ArduinoFirmata.prototype.write = function(bytes) { | ||
return this.serialport.write(bytes); | ||
}; | ||
ArduinoFirmata.prototype.pinMode = function(pin, mode) { | ||
this.write(ArduinoFirmata.SET_PIN_MODE); | ||
this.write(pin); | ||
switch (mode) { | ||
@@ -168,3 +164,3 @@ case true: | ||
} | ||
return this.write(mode); | ||
return this.write([ArduinoFirmata.SET_PIN_MODE, pin, mode]); | ||
}; | ||
@@ -181,5 +177,3 @@ | ||
} | ||
this.write(ArduinoFirmata.DIGITAL_MESSAGE | port_num); | ||
this.write(this.digital_output_data[port_num] & 0x7F); | ||
return this.write(this.digital_output_data[port_num] >>> 7); | ||
return this.write([ArduinoFirmata.DIGITAL_MESSAGE | port_num, this.digital_output_data[port_num] & 0x7F, this.digital_output_data[port_num] >>> 7]); | ||
}; | ||
@@ -190,5 +184,3 @@ | ||
this.pinMode(pin, ArduinoFirmata.PWM); | ||
this.write(ArduinoFirmata.ANALOG_MESSAGE | (pin & 0x0F)); | ||
this.write(value & 0x7F); | ||
return this.write(value >>> 7); | ||
return this.write([ArduinoFirmata.ANALOG_MESSAGE | (pin & 0x0F), value & 0x7F, value >>> 7]); | ||
}; | ||
@@ -198,5 +190,3 @@ | ||
this.pinMode(pin, ArduinoFirmata.SERVO); | ||
this.write(ArduinoFirmata.ANALOG_MESSAGE | (pin & 0x0F)); | ||
this.write(angle & 0x7F); | ||
return this.write(angle >>> 7); | ||
return this.write([ArduinoFirmata.ANALOG_MESSAGE | (pin & 0x0F), angle & 0x7F, angle >>> 7]); | ||
}; | ||
@@ -203,0 +193,0 @@ |
{ | ||
"name": "arduino-firmata", | ||
"private": false, | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Arduino Firmata implementation for Node.js", | ||
@@ -20,3 +20,4 @@ "main": "lib/arduino-firmata.js", | ||
"grunt-coffeelint": "git+https://github.com/geta6/grunt-coffeelint", | ||
"grunt-contrib-watch": "git+https://github.com/gruntjs/grunt-contrib-watch" | ||
"grunt-contrib-watch": "git+https://github.com/gruntjs/grunt-contrib-watch", | ||
"socket.io": "*" | ||
}, | ||
@@ -23,0 +24,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
110708
19
641
11
6
1