Hi.
There was an update on the ESP32 core for Arduino IDE and there were some breaking changes.
The hallRead() function no longer exists, so that feature is no longer supported.
The ledcSetup function is also no longer supported.
If you update to version 3.0, there are a few changes required to make the code compile. We’ll update the eBook in the upcoming weeks.
Here are the required changes for PWM:
#define LED_PIN 2
// setting PWM properties
const int freq = 5000;
const int ledChannel = 0;
const int resolution = 8;
Previously for version 2 ESP32 board add-on inside the setup function:
// configure LED PWM functionalities
ledcSetup(ledChannel, freq, resolution);
// attach the channel to the GPIO to be controlled
ledcAttachPin(LED_PIN, ledChannel);
ledcWrite(ledChannel, 0);
For the NEW version 3 ESP32 board add-on inside the setup function:
ledcAttachChannel(LED_PIN , freq, resolution, ledChannel);
ledcWrite(LED_PIN, 0);
Let me know if you can make it work. Otherwise, I can try to send you the correct code.
Regards,
Sara
We already updated the code to be compatible with the newest version.
You can find it here: https://github.com/RuiSantosdotme/ESP32-Course/blob/master/code/LED_PWM_Example_1/LED_PWM_Example_1.ino
We’re currently working on updating the eBook PDF.
All codes are updated now. We’ve just finished updating this morning. All links already redirect to the most recent code.
Regards,
Sara