This program takes the input from digital pin 9 and one buzzer and one ldr(light dependent resister) sensor has been connected with the pin respectively 7 and analog pin A0 with the ldr. buzzer's positive pin(+ve) is connected to registor which is connected to pin no 7. in case of LDR,One 2.2 KOhm registor is connected with one leg which is connected with angalog pin. It is also time dependent and having high and low voltage led.
when the room is dark,the buzzer tones and when there is light then noTones. So it can be used in case of dark room because of ldr.