diff --git a/examples/3_load_melody_from_file/3_load_melody_from_file.ino b/examples/3_load_melody_from_file/3_load_melody_from_file.ino index 8dd74e9..93167f2 100644 --- a/examples/3_load_melody_from_file/3_load_melody_from_file.ino +++ b/examples/3_load_melody_from_file/3_load_melody_from_file.ino @@ -1,8 +1,10 @@ /** * Melody Player library can load melodies from file. - * On ESP8266 and ESP32 there is an embedded portion of flash memory to store files and folders. It - * uses a file system, usually LittleFS or SPIFFS. You can upload files through specific plugins. - * For more info, look at: + * + * REMEMBER to upload the file system containing the files in the "data" directory before running + * this sketch. On ESP8266 and ESP32 there is an embedded portion of flash memory to store files and + * folders organized with a file system, usually LittleFS or SPIFFS. You can upload files through + * specific plugins. For more info, look at: * - On ESP8266: https://github.com/esp8266/arduino-esp8266fs-plugin * - On ESP32: https://github.com/me-no-dev/arduino-esp32fs-plugin */ @@ -12,7 +14,7 @@ int buzzerPin = 4; // This file does not exist -String missingMelodyFilePath = "missing.mel"; +String missingMelodyFilePath = "/missing.mel"; String melodyFilePath = "/jingle.mel"; MelodyPlayer player(buzzerPin); diff --git a/examples/4_load_rtttl_melody/4_load_rtttl_melody.ino b/examples/4_load_rtttl_melody/4_load_rtttl_melody.ino index c9f81cb..572bf9c 100644 --- a/examples/4_load_rtttl_melody/4_load_rtttl_melody.ino +++ b/examples/4_load_rtttl_melody/4_load_rtttl_melody.ino @@ -1,5 +1,7 @@ /** * Load and play an RTTTL melody from hardcoded literal string and from file. + * + * REMEMBER to upload the file system containing the files in the "data" directory. */ #include #include diff --git a/examples/5_play_melodies_simultaneously/5_play_melodies_simultaneously.ino b/examples/5_play_melodies_simultaneously/5_play_melodies_simultaneously.ino index f507bd3..7ebaaa3 100644 --- a/examples/5_play_melodies_simultaneously/5_play_melodies_simultaneously.ino +++ b/examples/5_play_melodies_simultaneously/5_play_melodies_simultaneously.ino @@ -1,11 +1,9 @@ /** * Play multiple melodies at the same time on different buzzers. * - * NOTE: This works only with playAsync(). - * - * For more information on how to enable multiple PWM outputs and - * the limitations of your board, check the wiki. - * https://github.com/fabianoriccardi/melody-player/wiki + * NOTE: To use this sketch on ESP32 you need to specify the LEDC channel in MelodyPlayer + * constructor. For more information visit the wiki: + * https://github.com/fabianoriccardi/melody-player/wiki/Limitations-of-multi-buzzer-configuration */ #include #include @@ -14,7 +12,12 @@ int buzzerPin1 = 4; int buzzerPin2 = 5; MelodyPlayer player1(buzzerPin1); + +#ifdef ESP32 +MelodyPlayer player2(buzzerPin2, 2); +#else MelodyPlayer player2(buzzerPin2); +#endif bool end; diff --git a/examples/6_transfer_playing_melody/6_transfer_playing_melody.ino b/examples/6_transfer_playing_melody/6_transfer_playing_melody.ino index d0a18b9..48eefdb 100644 --- a/examples/6_transfer_playing_melody/6_transfer_playing_melody.ino +++ b/examples/6_transfer_playing_melody/6_transfer_playing_melody.ino @@ -57,7 +57,7 @@ void setup() { void loop() { if (millis() - start > 2000 && !transfered) { transfered = true; - Serial.println("Continuing the melody on a different buzzer..."); + Serial.println("Continuing the melody playback on a different buzzer..."); player1.transferMelodyTo(player2); } diff --git a/examples/7_duplicate_playing_melody/7_duplicate_playing_melody.ino b/examples/7_duplicate_playing_melody/7_duplicate_playing_melody.ino index 81e7eb0..fa70982 100644 --- a/examples/7_duplicate_playing_melody/7_duplicate_playing_melody.ino +++ b/examples/7_duplicate_playing_melody/7_duplicate_playing_melody.ino @@ -52,7 +52,7 @@ void setup() { void loop() { if (millis() - start > 2000 && !transfered) { transfered = true; - Serial.println("Continuing the melody on a different buzzer..."); + Serial.println("Continuing the melody playback on both buzzers..."); player1.duplicateMelodyTo(player2); }