UNPKG

johnny-five-electron

Version:

Temporary fork to support Electron (to be deprecated)

37 lines (28 loc) 640 B
var five = require("../lib/johnny-five.js"); five.Board().on("ready", function() { // Initialize the RGB LED var led = new five.Led.RGB({ pins: { red: 6, green: 5, blue: 3 } }); // RGB LED alternate constructor // This will normalize an array of pins in [r, g, b] // order to an object (like above) that's shaped like: // { // red: r, // green: g, // blue: b // } //var led = new five.Led.RGB([3,5,6]); // Add led to REPL (optional) this.repl.inject({ led: led }); // Turn it on and set the initial color led.on(); led.color("#FF0000"); led.blink(1000); });