Skip to content

Instantly share code, notes, and snippets.

@fivdi
Created October 1, 2015 20:36
Show Gist options
  • Save fivdi/36632ab930a71ba62c16 to your computer and use it in GitHub Desktop.
Save fivdi/36632ab930a71ba62c16 to your computer and use it in GitHub Desktop.
'use strict';
var SerialPort = require('serialport').SerialPort;
var calls = 0;
var serialPort = new SerialPort('/dev/ttyAMA0', {
baudrate: 115200,
parser: function() {
calls++;
for (var i = 0; i < 10000; i++) {
console.log('call:' + calls + '\t i:' + i);
}
}
});
serialPort.once('open', function () {
setInterval(function () {
serialPort.write(new Buffer('t'));
}, 100);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment