/* CdS to Serial Ouptut the reading on the CdS pin to Serial. */ const int inputPin = A0; // use analog 0 (A0) as input pin const int ledPin = 13; // connect the LED to pin 13 int lightLevel = 0; // used to store the input value void setup() { Serial.begin(9600); // initialize serial communication pinMode(ledPin, OUTPUT); // make LED's pin an output } void loop() { lightLevel = analogRead(inputPin); // get an analog reading Serial.println(lightLevel); // print out the reading delay(500); // delay between reads }