UNPKG

johnny-five

Version:

The JavaScript Robotics and Hardware Programming Framework. Use with: Arduino (all models), Electric Imp, Beagle Bone, Intel Galileo & Edison, Linino One, Pinoccio, pcDuino3, Raspberry Pi, Particle/Spark Core & Photon, Tessel 2, TI Launchpad and more!

16 lines (12 loc) 280 B
var five = require("../lib/johnny-five.js"); var board = new five.Board(); board.on("ready", function() { var spdt = new five.Switch(8); var led = new five.Led(13); spdt.on("open", function() { led.off(); }); spdt.on("close", function() { led.on(); }); });