I have a parallax RFID reader and I am confused on where to start when using johnny-five with it. I am trying to use this as guidance - http://www.gumbolabs.org/2009/10/17/parallax-rfid-reader-arduino/ - but obviously that does not use johnny-five.
I don't know if I should be starting with a johnny-five object to read the data and interact with the sensor, or if I should skip that and be using serialport
directly. If I use serialport
how exactly do I do that?
https://github.com/RyanHirsch/j5-rfid
Output:
1381834286406 Board Connecting...
1381834286421 Serial Found possible serial port /dev/cu.usbmodemfa141
1381834286422 Board -> Serialport connected /dev/cu.usbmodemfa141
open
err undefined
results 3
Code:
var sp = new SerialPort("/dev/cu.usbmodemfa141", {
parser: serialport.parsers.readline("\r") ,
baudrate: 2400
}, false);
sp.open(function () {
console.log('open');
sp.on('data', function(data) {
console.log('data received: ' + data);
});
sp.write("ls\n", function(err, results) {
console.log('err ' + err);
console.log('results ' + results);
});
});