// Complete Instructions: https://RandomNerdTutorials.com/esp32-digital-inputs-outputs-arduino/
// set pin numbers
const int analogPin = 34; // the number of the pushbutton pin
//const int ledPin = 5; // the number of the LED pin
float voltageState=0;
// variable for storing the pushbutton status
int analogState = 0;
void setup() {
Serial.begin(115200);
// initialize the pushbutton pin as an input
pinMode(analogPin, INPUT);
// initialize the LED pin as an output
//pinMode(ledPin, OUTPUT);
}
void loop() {
// read the state of the pushbutton value
analogState = analogRead(analogPin);
voltageState=0.0008*analogState;
Serial.println(voltageState);
// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH
//if (analogState == HIGH) {
// turn LED on
//digitalWrite(ledPin, HIGH);
//Serial.println("bright");
delay(1000);
//} else {
// turn LED off
//digitalWrite(ledPin, LOW);
//Serial.println("dark");
//delay(2000);
//}
}