Skip to content

Commit

Permalink
update docs and fix typos in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianoriccardi committed May 15, 2022
1 parent ee5ee65 commit 28aafbb
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
10 changes: 6 additions & 4 deletions examples/3_load_melody_from_file/3_load_melody_from_file.ino
Original file line number Diff line number Diff line change
@@ -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
*/
Expand All @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions examples/4_load_rtttl_melody/4_load_rtttl_melody.ino
Original file line number Diff line number Diff line change
@@ -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 <melody_player.h>
#include <melody_factory.h>
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <melody_player.h>
#include <melody_factory.h>
Expand All @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 28aafbb

Please sign in to comment.