Skip to content

Project 2: Simple Switch

jwhitehorn edited this page Jan 12, 2013 · 1 revision

The circuit for this project consists of a momentary switch and a 10K resistor.

Circuit

The basic idea is that when the switch is pressed the app will notify us. Due to the way the circuit is designed, the pin will be high by default. Pressing the switch will bring the pin low. To invert this logic so that it's more in line with what you'd expect, we'll use Pi Piper's :invert => true option.

Sample code: https://raw.github.com/jwhitehorn/pi_piper/master/examples/simple_switch/simple_switch.rb

Clone this wiki locally