Ardunio Night Light
.jpg)
I changed nickchuang29's https://www.instructables.com/Arduino-Light/#discuss Arduino light into Arduino night light, I changed the light into 3 same colors because yellow light is better for sleeping rather than red, green, and yellow, and I also add a button to open and close the light. And at first, it is 3 lights and after a while, when your eyes adapt to the dark, it would change to 1 light.
PREPARE MATERIALS
Arduino Leonardo
breadboard
3 yellow LED lights
13 wires
1 button
3 220 ohm resistors
1 Ohm 1/4W Precision Resistor
CONNECT COMPONENTS



Connect the components exactly from the picture.
ARDUINO CODE
void setup() {
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
pinMode(10, INPUT);
}
void loop() { if(digitalRead(10)){
digitalWrite(9, HIGH);
delay(1200); //origial is 1500
digitalWrite(9, LOW);
digitalWrite(12, HIGH);
delay(1200); //origial is 1500
digitalWrite(12, LOW);
digitalWrite(11, HIGH);
delay(1200); //origial is 1500
digitalWrite(11, LOW); }else { digitalWrite(11, LOW); digitalWrite(12, LOW); digitalWrite(19, LOW); }
} //button
FIND OR MAKE a BOX


Find or make a box to hold your arduino, you can make some holes that can open and close so if it is too bright, you can close 1 hole.
FINISHED

https://youtu.be/-INT-D4RlcM