Created
December 19, 2015 00:30
-
-
Save xseignard/372722b7e24a44d119dd to your computer and use it in GitHub Desktop.
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
#include <SoftwareSerial.h> | |
int Rx_pin = 9; // to Somo Tx | |
int Tx_pin = 8; // to Somo Rx | |
SoftwareSerial Somo(Rx_pin,Tx_pin); | |
// Init Somo byte stream | |
byte init[] = {0x7E, 0x06, 0x00, 0x00, 0x1E, 0xFF, 0xDC, 0xEF}; | |
// Example byte stream to send to play track 001 | |
byte track1[] = {0x7E, 0x03, 0x00, 0x00, 0x01, 0xFF, 0xFC, 0xEF}; | |
// Example byte stream to send to play track 002 | |
byte track2[] = {0x7E, 0x03, 0x00, 0x00, 0x02, 0xFF, 0xFB, 0xEF}; | |
void setup() { | |
Somo.begin(9600); | |
delay(500); | |
Somo.write(init, sizeof(init)); | |
delay(100); | |
} | |
void loop() { | |
Somo.write(track1, sizeof(track1)); | |
delay(10000); | |
} |
Author
xseignard
commented
Dec 19, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment