General area when it fits no where else

Moderator: Mmiscool

User avatar
By Scugnizzo
#84260 Hi all,
I was wondering to drive a mini DF player with a wemos via serial. The df player uses sequences of hex data to perform various actions. For example, to play the song 1 I will send 7E FF 06 03 00 00 01 FE F7 EF. I have made several tests with no results. It's possible to do this? Thanks
User avatar
By Scugnizzo
#84280 UPDATE. tried to drive df player via PC with realterm and usb to TTL adapter. Works fine! But with wemos NOTHING happens.
Code: Select allmemclear
baudrate 9600
serialflush
button "Play",[play]
button "End", [fine]

[loop]
wait

[play]
serialprint chr(126) & chr(255) & chr(6) & chr(3) & chr(0) & chr(0) & chr(1)
serialprint chr(254) & chr(247) & chr(239)
goto [loop]

[fine]
end

Any suggestion?
Thanks
User avatar
By Scugnizzo
#84285 Finally it works!
I have tested wemos output (with serial2) on realterm. I don't know why, but you need to split the serial2print data in two different rows otherwise you'll receive a bad output.
Code: Select all
[play]
serialprint chr(126) & chr(255) & chr(6) & chr(3) & chr(0) & chr(0) & chr(1)
serialprint chr(254) & chr(247) & chr(239

This code will output :
7E FF 06 03 00 00 :shock: 00 :shock: FE F7 EF but if you move the last chr(1) on the first row at the start of the second row the output will be correctly
7E FF 06 03 00 00 01 FE F7 EF
and the df player will start to play the first song.
Bye