Skip to content

Commit

Permalink
Version1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Armin committed Jun 10, 2019
1 parent 80b6824 commit 984aa76
Show file tree
Hide file tree
Showing 5 changed files with 242 additions and 198 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Improved Arduino library version of the RTTTL.pde example code written by Brett
- Random play of melodies from array.
- Supports inverted tone pin logic i.e. tone pin is HIGH at playing a pause.
- Accepts even invalid specified RTTTL files found in the wild.
- Supports RTX format.
- Supports RTX format - 2 additional parameters: 1. l=<number_of_loops> 2.s=<Style[N|S|C]>).
- Tone style (relation of tone output to note length) and loop count can be set for a melody.

Youtube video of the RandomMelody example in action
Expand Down Expand Up @@ -45,6 +45,11 @@ More RTTTL songs can be found under http://www.picaxe.com/RTTTL-Ringtones-for-Tu

# Revision History

### Version 1.2.1
- Natural is the new default style.
- New RTTTLMelodiesSmall sample array with less entries.
- Parameter now order independent.
- Modified oneMelody example.
### Version 1.2.0
No Serial.print statements in this library anymore, to avoid problems with different Serial implementations.
- Function playRandomRtttlBlocking() + startPlayRandomRtttlFromArrayPGM() do not print name now. If needed, use new functions playRandomRtttlSampleBlockingAndPrintName() + startPlayRandomRtttlFromArrayPGMAndPrintName().
Expand Down
26 changes: 17 additions & 9 deletions examples/OneMelody/OneMelody.ino
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,37 @@

const int TONE_PIN = 11;

char StarWarsInRam[] =
"StarWars:d=32,o=5,b=45,l=2,s=N:p,f#,f#,f#,8b.,8f#.6,e6,d#6,c#6,8b.6,16f#.6,e6,d#6,c#6,8b.6,16f#.6,e6,d#6,e6,8c#6";

void setup() {
Serial.begin(115200);
while (!Serial); //delay for Leonardo
while (!Serial)
; //delay for Leonardo
// Just to know which program is running on my Arduino
Serial.println(F("START " __FILE__ "\r\nVersion " VERSION_EXAMPLE " from " __DATE__));

/*
* Play one melody
*/
playRtttlBlockingPGM(TONE_PIN, Bond);
playRtttlBlocking(TONE_PIN, StarWarsInRam);
delay(5000);
}

void loop() {
/*
* And another one, but use non blocking functions
* And all the others, but use non blocking functions
*/
startPlayRtttlPGM(TONE_PIN, TakeOnMe);
while (updatePlayRtttl()) {
/*
* your own code here...
*/
delay(1);
for (uint8_t i = 1; i < ARRAY_SIZE_MELODIES; ++i) {
const char* tSongPtr = (char*) pgm_read_word(&RTTTLMelodies[i]);
startPlayRtttlPGM(TONE_PIN, tSongPtr);
while (updatePlayRtttl()) {
/*
* your own code here...
*/
delay(1);
}
delay(2000);
}
delay(20000);
}
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=PlayRtttl
version=1.2.0
version=1.2.1
author=Armin Joachimsmeyer
maintainer=Armin Joachimsmeyer <[email protected]>
sentence=Plays RTTTL / RTX melodies/ringtones from FLASH or RAM.<br/>
Expand Down
Loading

0 comments on commit 984aa76

Please sign in to comment.