Shop OBEX P1 Docs P2 Docs Learn Events
SERIN commnad please help — Parallax Forums

SERIN commnad please help

Luis_PLuis_P Posts: 246
edited 2013-08-27 09:11 in BASIC Stamp
I have a nice Mp3 player that suppost to return a code after sending command from Bs2, but I don't know how to read that code!

to play a file (mp3) I use:

SEROUT RFID_TX, Baud, [$7E, 7, $A0, $30, $30, $30, $30, $31, $7E]

I want to get the return code to make sure the file is playing. the manual on page 8 is telling me TX pin will return a code after sending a comand.
I'm thinking something like:
SERIN RFID_RX

But I don't know how! Please helpWT9501M03.pdf

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2013-08-26 19:52
    Things to add
    retcode VAR Byte
    
    SERIN RFID_RX, Baud,[WAIT("~~"),retcode]  ' wait $7e $7e, grab next byte
    
    DEBUG HEX retcode, CR  ' display received retcode as a HEX value
    

    Look up about making an array in PBASIC Help.
    There are probably a few return codes sent back and my example only captures the first after the $7e $7e ($7e, or 254, is the ASCII code for the tilde ~)
  • FranklinFranklin Posts: 4,747
    edited 2013-08-26 19:54
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2013-08-27 09:11
    I'm curious why your pin designation is RFID? Not to nit-pick, but clarity in your code starts with pin, variable and constant designations.
Sign In or Register to comment.