Skip to content

Latest commit

 

History

History
66 lines (31 loc) · 1023 Bytes

switch-magnetic-door.md

File metadata and controls

66 lines (31 loc) · 1023 Bytes

Switch - Magnetic Door

Breadboard for "Switch - Magnetic Door"

docs/breadboard/switch-magnetic-door.png

Fritzing diagram: docs/breadboard/switch-magnetic-door.fzz

 

Run this example from the command line with:

node eg/switch-magnetic-door.js
const {Board, Switch} = require("johnny-five");
const board = new Board();

board.on("ready", () => {
  // Contact Mode: Normally Open (default!)
  const sw = new Switch(7);
  sw.on("open", () => console.log("open"));
  sw.on("close", () => console.log("close"));
});

Learn More

 

License

Copyright (c) 2012-2014 Rick Waldron waldron.rick@gmail.com Licensed under the MIT license. Copyright (c) 2015-2023 The Johnny-Five Contributors Licensed under the MIT license.