void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
ledcAttachPin(13,0); // attach PWM channel 0 to GPIO pin 34
ledcSetup(0,1000,8); // setup PWM 0 to 1kHz, with 8bits resolution (0-256)
}
void loop() {
// put your main code here, to run repeatedly:
for(int i=0; i<256; i++){
ledcWrite(0,i);
Serial.println(i);
delay(10); // this speeds up the simulation
}
for(int i=256; i>0; i--){
ledcWrite(0,i);
Serial.println(i);
delay(10); // this speeds up the simulation
}
}