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!

22 lines (16 loc) 390 B
var five = require("../lib/johnny-five.js"); var board = new five.Board(); board.on("ready", function() { var virtual = new five.Board.Virtual( new five.Expander("PCF8574") ); var leds = new five.Leds( Array.from({ length: 8 }, function(_, i) { return new five.Led({ pin: i, board: virtual }); }) ); leds.on(); this.repl.inject({ leds: leds }); });