PDA

View Full Version : Hex to Ascii to Decimal



khoog
- 31st July 2009, 04:44
I'm using serin and serout to communicate with a graphics module. Everything is working fine, but I can't figure out how to convert the incoming data to something useable (killed too many brain cells, I guess).

When the module sends a value like 30, it sends it in two bytes: 49 and 69.

49 = $31 = "1"
69 = $45 = "E"
$1E = 30

The question is how to do the above with PBP.

Jerson
- 31st July 2009, 05:27
Take a look at HEX2 var modifier in the SERIN / SEROUT command

this will translate var to 2 bytes of HEX