From 23ea3239ea35b205b39b8aeec9eb5da31d105b8d Mon Sep 17 00:00:00 2001 From: chechi666 <110476277+chechi666@users.noreply.github.com> Date: Fri, 10 Oct 2025 11:36:09 -0300 Subject: [PATCH] Update NonBlockingRtttl.cpp This version is updated to be compile with the arduino ESP32library V3.3 --- src/NonBlockingRtttl.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/NonBlockingRtttl.cpp b/src/NonBlockingRtttl.cpp index 723dffc..565799c 100644 --- a/src/NonBlockingRtttl.cpp +++ b/src/NonBlockingRtttl.cpp @@ -45,7 +45,7 @@ void nextnote(); // and https://github.com/espressif/arduino-esp32/issues/1720 #if defined(ESP32) void noTone(){ - ledcWrite(0, 0); // channel, volume + ledcWrite(pin, 0); // channel, volume } void noTone(int pin){ @@ -53,8 +53,8 @@ void noTone(int pin){ } void tone(int frq) { - ledcWriteTone(0, frq); // channel, freq - ledcWrite(0, 255); // channel, volume + ledcWriteTone(pin, frq); // channel, freq + ledcWrite(pin, 255); // channel, volume } void tone(int pin, int frq, int duration){ @@ -72,8 +72,7 @@ void begin(byte iPin, const char * iSongBuffer, byte iLoopCount, unsigned long i //init values pin = iPin; #if defined(ESP32) - ledcSetup(0, 1000, 10); // resolution always seems to be 10bit, no matter what is given - ledcAttachPin(pin, 0); + ledcAttach(pin, 1000, 10); #endif buffer = iSongBuffer; bufferIndex = 0;