void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(2, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int pot = analogRead(13);
int flex = map(pot, 0, 4095,0,180);
Serial.println(flex);
if (flex > 90)
{
digitalWrite(2, HIGH);
}
else
digitalWrite(2, LOW);
//delay(100); // this speeds up the simulation
}