Skip to content

Instantly share code, notes, and snippets.

@garethfoote
Last active May 31, 2017 10:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garethfoote/8ab2cb28283e678b25322b8cd5ebca0c to your computer and use it in GitHub Desktop.
Save garethfoote/8ab2cb28283e678b25322b8cd5ebca0c to your computer and use it in GitHub Desktop.
Using soft serial for MP3 Trigger.
#include <SoftwareSerial.h>
SoftwareSerial sSerial(10, 11); // RX, TX
void setup() {
Serial.begin(9600);
while (!Serial);
// set the data rate for the SoftwareSerial port
sSerial.begin(38400);
// Set volume
sSerial.print( "v" );
sSerial.write( '0' ); // 0 = maximum volume, 255 = minimum volume
}
void loop() {
// Play track 1
sSerial.write('T');
sSerial.print(1);
delay(2000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment