Created
August 8, 2013 17:22
-
-
Save Fabryz/6186690 to your computer and use it in GitHub Desktop.
Simple Node.js script to write text on the Pi Lite
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").SerialPort; | |
var serialPort = new SerialPort("/dev/ttyAMA0", { | |
baudrate: 9600 | |
}, false); | |
serialPort.open(function () { | |
console.log('Connected to Pi Lite'); | |
var text = "Hello World"; | |
serialPort.write(text, function(err, results) { | |
if (err) { | |
console.log('Error: '+ err); | |
} | |
//console.log('Result: '+ results); | |
process.exit(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment