Tilt Switch Activated LED's
Turns on and off a light emitting diode(LED) connected to digital pin 13 and 12, when activating the Tilt Switch or a pushbutton attached to pin 2. When the tilt switch gives the Arduino the Off Signal, LED12 Will Switch off and LED13 will turn on.
Tilt Switch or Button Activated LED's
Turns on and off a light emitting diode(LED) connected to digital
pin 13 and 12, when activating the Tilt Switch or a pushbutton attached to pin 2.
When the tilt switch gives the Arduino the Off Signal, LED12 Will
Switch off and LED13 will turn on.
---How To Connect your switch to Digital pin 2
LED1 to Digital Pin13 and LED2 to Digital Pin12
Connect the switch Via a 100K Resistor to the 5V Pin on the Arduino
Connect Led ground to any ground on the Arduino board
The circuit: * LED attached from pin 13 to ground * LED attached from pin 12 to ground * pushbutton attached to pin 2 from +5V * 10K resistor attached to pin 2 (switch/button) from ground
- Note: on most Arduinos there is already an LED on the board attached to pin 13.
created 31/12/2013 by Ryner GeekSpot http://www.GeekSpot.co.za modified 30 Aug 2011 by Lulouch GeekSpot
For bugs or help email: [email protected] or [email protected]
Tested by Ryner and Eesa 2013-12-31