Devices & Components
Arduino Uno Rev3
Resistor 10k ohm
Jumper wires (generic)
Breadboard (generic)
LDR, 5 Mohm
Software & Tools
Arduino IDE
Project description
Code
Code
arduino
The program prints the value of LDR to Serial Monitor
1const int LDR = A0; 2int input_val = 0; 3 4void setup() 5{ 6 Serial.begin(9600); 7} 8 9void loop() 10{ 11 input_val = analogRead(LDR); 12 Serial.print("LDR Value is: "); 13 Serial.println(input_val); 14 delay(1000); 15}
Downloadable files
Breadboard Diagram
Make connections as shown in the breadboard diagram
Breadboard Diagram
Connections
The figure shows the close up of the connections
Connections
Comments
Only logged in users can leave comments