Using a Sparkfun MP3 Trigger with a BS2
scary terry
Posts: 24
I'm using a BS2 to trigger audio tracks from a "Sparkfun MP3 Trigger" MP3 player. There are two modes to serially trigger a specific track, ASCII and binary. Here are the details on each one from the user guide:
Command: Trigger (ASCII)
Number of bytes: 2
Command byte: T
Data byte: N = ASCII 1 through 9
Comments: If it exists, the track with the filename 00Nxxxx.MP3 will be started, where N is the data byte.xxxx can be any valid filename characters of any length.
Command: Trigger (binary)
Number of bytes: 2
Command byte: t
Data byte: n = 1 to 255
Comments: If it exists, the track with the filename NNNxxxx.MP3 will be started, where NNN is the ASCII equivalent of the data byte n with leading 0s. xxxx can be any valid filename characters of any length.
I'm able to use the ASCII mode with a command like this: "SEROUT toMP3, Baud, ["T2"]" but that's only good for nine tracks and I need to play more.
I'm trying to use the binary mode but I can't figure out how to format the SEROUT command to play a track. Any ideas on this?
Thanks for your help.
Command: Trigger (ASCII)
Number of bytes: 2
Command byte: T
Data byte: N = ASCII 1 through 9
Comments: If it exists, the track with the filename 00Nxxxx.MP3 will be started, where N is the data byte.xxxx can be any valid filename characters of any length.
Command: Trigger (binary)
Number of bytes: 2
Command byte: t
Data byte: n = 1 to 255
Comments: If it exists, the track with the filename NNNxxxx.MP3 will be started, where NNN is the ASCII equivalent of the data byte n with leading 0s. xxxx can be any valid filename characters of any length.
I'm able to use the ASCII mode with a command like this: "SEROUT toMP3, Baud, ["T2"]" but that's only good for nine tracks and I need to play more.
I'm trying to use the binary mode but I can't figure out how to format the SEROUT command to play a track. Any ideas on this?
Thanks for your help.
Comments
trackNo is any variable (or constant or expression for that matter) with a value from 1 to 255.
Try SEROUT toMP3,Baud,["t", track] where n is a byte containing 1 to 255 ( track VAR Byte )
Terry