Arduino Light on and Off
My design was inspired by https://www.instructables.com/Arduino-LED-Night-L... This Arduino project can add a night light to your room, and you can switch modes at any time. There are two modes in total. The first mode is night light mode, and the second mode is normal lighting. During the switching process, there are two buttons. If you want the night light to turn bright yellow, just press the start button once. In this case, you can press the second button to turn off the machine. If all functions are needed, press the start button twice until the LED turns blue. During each switching process, the buzzer will play a sound to let you know that the machine is starting the switching mode.
Prepare Materials That Are Need.
- Arduino Leonardo Board*1
- Breadboard*1
- LED Lights ( Blue and yellow ) each*1
- Button*2
- 1K Ω resistor (blue) *2
- male to male wires *8
- Arduino 0.5W speaker *1 (with female wires connected)
- 100 ohm resistor (the color of three strikes in the middle-brown black brown) *2
- alligator clip to male wires *4
- pin header *6 For connecting Arduino:
- Laptop
- microUSB to USB cable *1 - USB to type c dongle *1 (if needed)
- Shoe box for covering the breadboard and your Arduino
Staring Setting Up Your Board With the Following Photo Below:
Upload Your Code to Your Arduino Leonardo
Put Your Arduino in a Shoe Box
Dig Hole on Your Shoe Box to See Arduino Inside
You Are Done With This !!!!
View What I've Changed
I changed tone and delay of the LED to faster, changed the for ++i to i++ and Serial begin 9600 to 8400.