You mean this one?
In that case it would be
uint16_t num = 1234;
uint8_t lo = num & 0xFF;
uint8_t hi = num >> 8;
sendCmd(0x12, hi, lo);
// optionally you can request a reply from the MP3 module via
// sendCmd(0x12, hi, lo, true);
But in order to have that work you need to have your mp3 files named as four digit numbers with leading zeros (e.g. 0123.mp3
) and stored in a root folder mp3
.
Your request reply in your example above means this
0x7e 0xff 0x06 0x41 0x00 0x00 0x00 0xfe 0xba 0xef // 0x41 Reply ? [DH]=0, [DL]= 0~? Return code when command feedback is high
0x7e 0xff 0x06 0x40 0x00 0x00 0x06 0xfe 0xb5 0xef // 0x40 Error ? [DH]=0, [DL]= 0~7 Error code(Returned codes not yet analyzed)
0x41
indicated that you have requested a reply but the module doesn't request you to reply.
0x40
provides the error code 0x06
(what that means might be found in the datasheet of the MP3 chip)