Switch
Run with:
node eg/switch.js
var five = require("johnny-five");
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();
});
});
Illustrations / Photos
Switch - SPDT
Fritzing diagram: docs/breadboard/switch-spdt.fzz
Switch - SPST
Fritzing diagram: docs/breadboard/switch-spst-rocker.fzz
License
Copyright (c) 2012, 2013, 2014 Rick Waldron waldron.rick@gmail.com Licensed under the MIT license. Copyright (c) 2014, 2015 The Johnny-Five Contributors Licensed under the MIT license.