Photoresistor,also called photocell, is a light sensor. Its resistor changes with light.
This project will use photoresistor to detect light and turn on/off an LED light.
Download photoresistor.ino sketch and load it into Arduino.
I detected a little error in the sketch ;
pinMode(photocellPin, INPUT); // declare the ledPin as an OUTPUT
the comment is just copy-pasted from above. It should be ;
pinMode(photocellPin, INPUT); // declare the photocellPin as an INPUT
Thanks for the correction!
You must be logged in to post a comment