From 5c8197b2f86be9400be462583c14af40d6419a3f Mon Sep 17 00:00:00 2001 From: Antoine Beauchamp Date: Wed, 7 Aug 2024 19:13:02 -0400 Subject: [PATCH] Fixed compilation since migrating to ESP core v3.0+. See https://forum.arduino.cc/t/making-tones-with-esp32-pwm-poorly-documented/1279751 for details. --- examples/ESP32Rtttl/ESP32Rtttl.ino | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/ESP32Rtttl/ESP32Rtttl.ino b/examples/ESP32Rtttl/ESP32Rtttl.ino index e5039c7..c7520c8 100644 --- a/examples/ESP32Rtttl/ESP32Rtttl.ino +++ b/examples/ESP32Rtttl/ESP32Rtttl.ino @@ -24,8 +24,7 @@ void esp32Tone(uint8_t pin, unsigned int frq, unsigned long duration) { } void esp32ToneSetup(uint8_t pin) { - ledcSetup(0, 1000, 10); // resolution always seems to be 10bit, no matter what is given - ledcAttachPin(pin, 0); + ledcAttach(0, 1000, 10); // resolution always seems to be 10bit, no matter what is given } void setup() {