Created
June 27, 2011 21:06
-
-
Save voodootikigod/1049838 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("serialport"); | |
var SerialPort = serialport.SerialPort; | |
// localize object constructor | |
var sys = require("sys"); | |
var port = "/dev/tty.usbmodemfd531"; | |
//var port = "/dev/tty.usbserial-A6007zeJ"; // RFID reader | |
var serial_port = new SerialPort(port, { | |
baudrate: 9600, | |
// parser: serialport.parsers.raw | |
parser: serialport.parsers.readline("\r") | |
}); | |
serial_port.on("data", function (data) { | |
console.log("new data"); | |
sys.puts("here: "+data); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment