Express plugin for communicating Arduino.
Download SHOGUN and fix your app.js.
Add only this codes.
var Shogun = require('../shogun/shogun').Shogun;
var PORT = '/dev/cu.usbmodem26421'
var shogun = new Shogun(PORT, app);
It's very easy. Please see express-sample on top directory for detail.
Write "shogun-arduino/shogun-arduino.ino" to your arduino.
/arduino/[pin number]/{in, out}
/arduino/d1/out
- Setting pinMode of pin 1 to OUTPUT.
/arduino/d11/in
- Setting pinMode of pin 11 to INPUT.
/arduino/[pin number]/[value]
/arduino/d1/high
- You access this path, then a pin 1 on your arduino gets high as digital signal.
/arduino/d3/low
- This path is same. A pin 3 gets a low as digital signal.