Last active
May 2, 2017 18:25
-
-
Save unknowndomain/32d1a6d883d4cecb8716597ce859c0bc to your computer and use it in GitHub Desktop.
This is a basic example of playing five short MP3s in a loop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() { | |
// Start the serial port at 38.4K | |
Serial1.begin( 38400 ); | |
// Set volume | |
Serial1.print( "v" ); | |
Serial1.write( 0 ); // 0 = maximum volume, 255 = minimum volume | |
} | |
void loop() { | |
// Loop from 1 to 5 | |
for ( int i = 1; i <= 5; i++ ) { | |
// Play file i ( 1 to 5 ) | |
Serial1.print( "p" ); | |
Serial1.write( i ); | |
// Wait a bit | |
delay( 1000 ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment