/* Simple test of the functionality of the photoresistor Connect the photoresistor one leg to pin A0, and pin to +5V Connect a resistor (around 10k from pin A0 to GND). */ int LDR_Pin = A0; //analog pin A0 void setup(){ Serial.begin(9600);//Begin serial communcation } void loop(){ int LDRReading = analogRead(LDR_Pin); Serial.println(LDRReading); //Write the value of the photoresistor to the serial monitor. delay(250); //just here to slow down the output for easier reading. }