// set pin numbers
const int sensorPin = 34; // the number of the pushbutton pin
//const int sensorPin = 5; // the number of the LED pin
// variable for storing the pushbutton status
int sensorValue = 0;
void setup() {
Serial.begin(115200);
// initialize the pushbutton pin as an input
pinMode(sensorPin, INPUT);
// initialize the LED pin as an output
//pinMode(ledPin, OUTPUT);
}
void loop() {
// read the state of the pushbutton value
sensorValue= analogRead(sensorPin);
Serial.println(sensorValue);
delay(1000);
// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH
if (sensorValue >= 1560) {
// turn LED on
Serial.println("Dark");
//digitalWrite(ledPin, HIGH);
} else {
// turn LED off
Serial.println("Bright");
//digitalWrite(ledPin, LOW);
}
}