https://github.com/danielesteban/node-arduino
Node module to interact with the Arduino
https://github.com/danielesteban/node-arduino
Last synced: 3 days ago
JSON representation
Node module to interact with the Arduino
- Host: GitHub
- URL: https://github.com/danielesteban/node-arduino
- Owner: danielesteban
- Created: 2013-03-22T01:27:23.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2013-03-23T08:17:15.000Z (over 13 years ago)
- Last Synced: 2025-10-19T19:32:34.249Z (9 months ago)
- Language: JavaScript
- Size: 145 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
node-arduino
============
A node module for interfacing with the Arduino
**Installation:**
npm install git://github.com/danielesteban/node-arduino.git
**Usage:**
```javascript
var Arduino = require('arduino');
Arduino.on('req', function(device, func, data) {
switch(func) {
case 0:
//Do something
break;
case 1:
//Do something else
break;
}
});
Arduino.on('error', function(err) {
console.log(err);
});
Arduino.connect('/dev/tty.usbserial', function() {
console.log('Connection successful');
});
//To send a Request to the arduino:
var device_id = 1,
func = 255,
data = new Buffer(['d', 'a', 't', 'a']);
Arduino.req(device_id, func, data, function(data) {
//Do something with the returned value
});
//There's also a helper for sending large numbers (like timestamps)...
Arduino.req(1, 0, Arduino.numToBuffer(3141592653));
```
**License:**
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the [GNU General Public License](https://github.com/danielesteban/node-arduino/blob/master/LICENSE)
along with this program. If not, see .