This package is designed to allow you to control and program an arduino chipset with JavaScript. It leverages the node-serialport code base, so ensure that you have that installed. In order to see what this package can do, please watch this presentation from JSConf EU 2010 by Nikolai Onken and Jörn Zaefferer.
Using node-arduino is pretty easy because it is pretty basic. It is essentially a wrapper with arduino specific message handling around the node-serialport library.
npm install git://github.com/kyungw00k/node-arduino.git
- Opening an arduino board:
var arduino = require("arduino") , myBoard = arduino.connect("/dev/tty-usbserial1");
- Getting pin 7 digital value
var arduino = require("arduino") , myBoard = arduino.connect("/dev/tty-usbserial1"); myBoard.pinMode(7, arduino.INPUT); setInterval(function () { myBoard.digitalRead(7, function(data) { console.log(data); }); }, 100);