Devices & Components
Arduino Uno Rev3
9V battery (generic)
Breadboard (generic)
9V Battery Clip
Photo resistor
Jumper wires (generic)
Resistor 100k ohm
USB-A to Mini-USB Cable
Software & Tools
Arduino Web Editor
Arduino IDE
Project description
Code
CODE
arduino
1int sensorPin = A0; // select the input pin for LDR 2 3int sensorValue = 0; // variable to store the value coming from the sensor 4 5void setup() { 6 Serial.begin(9600); //sets serial port for communication 7} 8void loop() { 9 sensorValue = analogRead(sensorPin); // read the value from the sensor 10 Serial.println(sensorValue); //prints the values coming from the sensor on the screen 11 12 delay(100); 13}
Downloadable files
photoresistor-circuit_l0L3AxxPwf.png
photoresistor-circuit_l0L3AxxPwf.png

photoresistor-circuit_l0L3AxxPwf.png
photoresistor-circuit_l0L3AxxPwf.png

Comments
Only logged in users can leave comments