See the following sketch for ideas. The parts are available at Hacktronics.
/* Cds Connections: CdS Pin 1 to +5v CdS Pin 2 to Analog Pin 3 10k ohm resistor pin 1 to Analog Pin 3 10k ohm resistor pin 2 to Gnd */ int analogPin = 3; // CdS (ldr) connected to analog pin 3 int val = 0; // variable to store the read value void setup() { Serial.begin(9600); } void loop() { val = analogRead(analogPin); // read the input pin Serial.println(val); delay(100); }

