Skip to content

Instantly share code, notes, and snippets.

@konsumer
Created September 26, 2012 16:44
Show Gist options
  • Save konsumer/3789107 to your computer and use it in GitHub Desktop.
Save konsumer/3789107 to your computer and use it in GitHub Desktop.
Basic analog read, using Firmata
var firmata = require('firmata');
var analogPin = 3;
var board = new firmata.Board('/dev/tty.usbmodemfd121', function(err) {
if (err){
console.log(err);
process.exit(1);
}
setInterval(function(){
board.analogRead(analogPin, function(val){
console.log(val);
});
}, 500);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment