UNPKG

node-ardx

Version:

Exercises for exploring the Arduino Experimenter's kit using johnny-five

13 lines (11 loc) 273 B
var j5 = require("johnny-five"); var myBoard, relayPin, val; myBoard = new j5.Board(); relayPin = 2; val = 0; myBoard.on("ready", function() { this.pinMode( relayPin, 1 ); this.loop( 1000, function() { this.digitalWrite( relayPin, (val = val ? 0 : 1) ); }); });