Create the pictured circuit using the following items:
For each additional LED you will need:
Watch the video to see how the circuit should work. When less light is sensed, by covering the photoresistor, the light comes on. When more light is sensed, by removing covering from the sensor, the light goes off.
Change the values in the code to alter the sensitivity to light.
Add additional LEDs to create more light, or to allow lights to go on and off in a sequence like fairy lights or Christmas lights.
Create a new sketch titled nightLight. Enter the code and upload.
Test the light levels in the room by opening the Serial Monitor and checking what light level values are displayed when the photoresistor, or LDR, is uncovered and also test what values would indicate the LDR is covered.
NOTE: If incorporating an LDR in your final project, you will need to test the coded product in a suitable location at different times of the day and evening to ensure the values you code in will work in the environment in which the final product will be used. To be really fancy, you could include a potentiometer in the circuit that allows the user to modify the light sensitivity value when the product is placed in the location it will be used in.