Process
To create this product, I approached the problem in small segments. I first established how the alarm was to be tripped. I wanted the alarm to be very simple to use and not require reprogramming between uses. With that in mind, I established a simple delay timer. After the alarm button is pushed, the device waits a programmed amount of time before it starts the alarm. It is currently eight seconds, but it could easily be coded to a desired amount of sleep time. It took some trial and error to get this right, so during this process I also added a "stop" button. This button would not be used in the final product, but it was instrumental in testing the code.
Next, I established my alarm tone. Using code from SparkFun, I was able to establish a tune that would be played when the alarm went off in the morning. For simplicity's sake, I also incorporated the flashing of the light directly into the tone loop. This provided the added benefit of the LED blinking with the music.
After the alert sounds and lights were completed, I began work on how the device would be turned off. Using the code from class as an example, I programmed a function that would turn off the alarm once a photo resistor experienced prolonged, blight light.