An example Meteor app showing communication with an Arduino Uno. This project uses the meteor-package-serialport meteor package, which is serialport repackaged for Meteor.
Be sure to plug in your Arduino to the serial port of your computer before starting meteor. The Arduino file for this project is included in this repository here. Upload it to your device and change the path:
var serialPort = new SerialPort.SerialPort("/yourPath", {
baudrate: 9600,
parser: SerialPort.parsers.readline('\r\n')
});
Once you start meteor, you should be able to turn on and off the LED on the Arduino board from a button on the app, which should also change from red(off) to green(on).
An alternative to using the meteor-serial package is to use the serialport node package via npm. To do so, change this:
var serialPort = new SerialPort.SerialPort("/yourPath", {
baudrate: 9600,
parser: SerialPort.parsers.readline('\r\n')
});
to:
var SerialPort = Meteor.require('serialport');
var serialPort = new SerialPort.SerialPort("/yourPath", {
baudrate: 9600,
parser: SerialPort.parsers.readline('\r\n')
});
This example has been updated to Meteor 1.1 and Meteor Streams has been removed since it has been deprecated.