concept remote switch in category javascript

appears as: remote switches, remote switches
JavaScript on Things: Hacking hardware for web developers

This is an excerpt from Manning's book JavaScript on Things: Hacking hardware for web developers.

The next step may require some ingenuity depending on the specifics of your device’s circuit board: you need to attach wires to each side of the button zig-zags (two wires per button). Subsequently you’ll be able to turn remote switches on and off by controlling—making and breaking—connections between these wires.

9.3.3. Integrating the gesture sensor and remote switches

You can now edit index.js to add some quick testing code, as shown in the following listing. Before you get to the big combination step—hooking up the remote switches—you can test for different direction swipe events and log them to the console.