Today we will make Arduino Bed BackLights! In Which led Fade is controlled by a Push Button!.
When we Press the Push Button the Lights Starts Fading in and out and when we release the Push button then Lights Stop at that brightness. When we again press the button then lights will again fade in and out from that position.
I think a video will explain it more Smoothly so Please see it .
Step 1: Video of LEDs in Action
Please See the Video To See what the code does.
Step 2: Get the Parts .....
1x Push Button
4x UV Lights ( Or any color of your choice but remember to add a resistor if using red or yellow LEDs)
1x 10k Resistor
Arduino Uno (Obviously)
[Mine is a Clone which I Bought from eBay]
Step 3: Solder the LEDs in Parallel
Step 4: Now the Push Button
Step 5: Solder Solid Core Jumper to Wires
We will be using this to connect to Arduino directly.
Step 6: Add 10K Resistor
Without this it Will not Work!
Step 7: The Code!
I made this Code with the Intermixing of Button and Fade Example!
As the Result i could see the fade effect only when i pushed my Button!
(Right Click and Click "Save Link" ^^ to get the File)
Step 8: Connections to Arduino
The wire of button which was Soldered with a resistor will be Attached to Pin 2 and other Wire to +5v Pin.
Step 9: Now Bed ( We Will Stick Behind It )
You can see that there is a plenty full space behing my bed.
Step 10: Stick the LEDs on Wall to Give a Effect.
This will give effect when leds are lit.
Step 11: Now Stick the Arduino With Double Tape
Apply the Double Tape to Arduino and Stick it to Wall or Bed.
Step 12: Connect the Arduino With a 5v Power Source
Step 13: Run It!
Hurray!! We Have Made it!
Impress your Friends with this cool Effects in your room!