Skip to content

Instantly share code, notes, and snippets.

@joshmarinacci
Created July 11, 2014 23:17
Show Gist options
  • Save joshmarinacci/1550cfdb710960ff64fa to your computer and use it in GitHub Desktop.
Save joshmarinacci/1550cfdb710960ff64fa to your computer and use it in GitHub Desktop.
var SerialPort = require('serial-port');
var sp = new SerialPort('/dev/ttyUSB0');
sp.on('open', function() {
sp.write('<ID01><PA>', function(err, res){
if(!err) {
sp.write('<ID01><PA>$1', function(err, res) {
if(!err) {
console.log("yay!");
}
})
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment