void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(4,OUTPUT);
pinMode(12, INPUT);
}
void loop() {
int value=analogRead(12);
Serial.println(value);
int bright=map(value,0,4095,0,255);
analogWrite(4,bright);
delay(500); // this speeds up the simulation
}