Created
July 11, 2014 23:17
-
-
Save joshmarinacci/1550cfdb710960ff64fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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