Bs2 send ASCII code to play mp3 file

Luis_PLuis_P Posts: 114
edited March 2013 in BASIC Stamp Vote Up0Vote Down
Dear friends,
I forgot how to do this! using the Bs2 SEROUT commands to play my mp3 module that accepts serial control mode.
To play an specific file example song 00001.mp3

ASCII codes:

Start code: 7E
Data length: 07
Operation code: A0
Ten thousands digit: 30H
Thousands digit: 30H
Hundreds digit: 30H
Tens digit:30H
Units digit: 31H
End code: 7E

I tried:

SEROUT 1, 9600, ["7E", "07", "A0", "30", "30", "30", "30", "31", "7E"]

doesn't work! 42242.pdf


  • 3 Comments sorted by Date Added Votes
  • Mike GreenMike Green Posts: 22,601
    edited March 2013 Vote Up0Vote Down
    The quotes are for ASCII characters. To send your information, you'd need

    SEROUT <pin>,<Baud>, [ $7E, 7, $A0, DEC5 1, $7E]

    Read the chapter on the SEROUT statement and Appendix C of the BASIC Stamp Syntax and Reference Manual to get a better understanding of how this statement works and what the various items like DEC5 do. Also remember that you can't just put the Baud into the SEROUT statement. The 2nd parameter is more complex than that and is explained thoroughly in that chapter.
  • Luis_PLuis_P Posts: 114
    edited March 2013 Vote Up0Vote Down
    Gracias! Miguel Verde :)
Sign In or Register to comment.