Hello,
I am testing the basics of a PWM output on an esp32 WROOM. If I believe this diagram (https://docs.espressif.com/projects/esp-idf/en/v5.1/esp32/_images/esp32-devkitC-v4-pinout.png) pins 0, 2 and 21 seem to support PWM.
But in practice, the following program only works with pin 0. The others do not produce any signal to the oscilloscope ...
#define pwmChannel 0
#define frequence 500
#define resolution 8
#define BUZZER_PIN 0
//#define BUZZER_PIN 21
void setup() {
//pinMode(BUZZER_PIN, OUTPUT);
ledcAttach(BUZZER_PIN, frequence, resolution);
ledcWrite(pwmChannel, 0);
}
void loop() {
ledcWrite(
pwmChannel,
127
);
delay(100);
ledcWrite(
pwmChannel,
0
);
delay(100);
}
Do you have any idea why?