


#LIGHT ALARM CLOCK FULL#
The light will stay at full brightness for the same amount of time it fades in before automatically turning off. Enter the time you want the light to reach full brightness and how long you want the fade in to be in integer minutes.

The drop-down menu contains 7 system modes, selecting one will display the necessary settings below. Instead, pressing the "Engage" button with no settings selected will turn the lights off.

The last button is supposed to turn off all lights, but for some reason that isn't functioning with this version of the code. The slider controls the brightness of the digital clock, and that is updated whenever you toggle the display mode or turn the clock on. The next two buttons toggle the digital time display and whether it displays time in 12 hr or 24 hr format. The top button is the main "enter" or "engage" button. When the page loads you will see four buttons, a slider, and a drop down menu. Since this was my first time using HTML, I learned mostly using. To change the appearance of the settings page you will have to edit the HTML, and there are plenty of other tutorials online for that. The page scales to the width of your browser and does look a bit better on mobile. The settings are fairly straight forward. When you hit a button, your browser sends an html form to the board with the current settings and the board adopts those settings and sets the displays. The changes you make do not affect the board until you hit one of the buttons. Once you connect, the board sends the HTML file to your browser, which decodes it and displays page. You will then have to connect to the IP address you see when you connect to and the port you set up the lamp's local IP to be on. If you want to connect to your lamp from anywhere in the world, you will have to set up port forwarding on your router. I changed the port on my lamp as well, so to connect I navigate to 192.168.0.170:301/. You have to connect by the IP address of the board, so be sure to reserve a static IP on your router. After the clock is set, the web server starts and you can connect via your favorite browser. It connects to your home WiFi and then contacts a NIST server to get the current time to set the internal clock.
#LIGHT ALARM CLOCK CODE#
When you connect the board to power, the board's code starts, like any arduino. The code in this project is separated into two files: The code run by the board, and the HTML stored in the board's memory that it sends to the browser when you navigate to the web page. Don't forget adapters for the power supply.I recommend using whatever your local hardware store sells for table top lamps. 24AWG wire (I recommend multiple colors).IF the strip doesn't have an adhesive backing: scotch tape and super glue.I would recommend a strip with at least 60LEDs. The arduino code is set up for the RGBW, so you'll have to rewrite it if you want to use an RGB strip. My strip has 60LEDs/meter, but is no longer sold. 1 meter addressable RGBW LED strip, sk6812.4 digit 7-segment display with TM1637 chip, I used one of these.White or clear plastic filament (for the shade, the mount can be any color you have).3D printer with at least 150mm x 150mm build area.Browser (I used chrome, but any should work, especially if it lets you see the html code working).Notepad++ (for editing the HTML if you want).Libraries needed for the code installed.
