Shop OBEX P1 Docs P2 Docs Learn Events
Bs2 send ASCII code to play mp3 file — Parallax Forums

Bs2 send ASCII code to play mp3 file

Luis_PLuis_P Posts: 246
edited 2013-03-01 12:57 in BASIC Stamp
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

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2013-03-01 12:20
    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: 246
    edited 2013-03-01 12:57
    Gracias! Miguel Verde :)
Sign In or Register to comment.