Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/NonBlockingRtttl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ 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){
noTone();
}

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){
Expand All @@ -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;
Expand Down