2 different PWM frequencies required, but ledcAttachChannel was not declared in this scope
Posted: Sat Jan 27, 2024 7:40 pm
I need two different frequencies for my project, 4KHz and 20KHz.
The use of:
deliver on both channels/Pins 20KHz;
The use of:
deliver on both channels/Pins 4KHz;
If I try to fix the channels with:
I get the Message: Compilation error: 'ledcAttachChannel' was not declared in this scope
HW is:
ESP32-C6-DevKitC-1 with 3.0.0 alpha package on Arduino IDE
The use of:
Code: Select all
ledcAttach(2, 4000,8);
ledcWrite(2, 127);
ledcAttach(10, 20000,8);
ledcWrite(10, 127);
The use of:
Code: Select all
ledcAttach(10, 20000,8);
ledcWrite(10, 127);
ledcAttach(2, 4000,8);
ledcWrite(2, 127);
If I try to fix the channels with:
Code: Select all
ledcAttachChannel(2, 4000, 8, 0);
ledcAttachChannel(10, 20000, 8, 1);
HW is:
ESP32-C6-DevKitC-1 with 3.0.0 alpha package on Arduino IDE