BS1 HEX Formatting in the DEBUG statement?
jongarr
Posts: 11
Hi,
·· I am using the parallax rfid reader to read the values from cards.· So far I have gotten good results.· I'd like to see the card values as hex characters in the debug terminal.· I looked up hex printing in the Editor Developer system (v2.1)·and saw that the $ symbol should print bytes in hex.· This is not working with my BS1 (v1.4).· The help also mentions that % will print a byte in binary format.· This does work with my bs1.· Is there another character I should be using for hex printing?
Thanks,
Jon
PS - The RFID file for the BS1 provided on http://www.parallax.com/detail.asp?product_id=28140·contains an error.· The SERIN statements are broken onto multiple lines which causes unpredictable reads in the bs1.· Condensing the SERIN lines to one line, like this fixes the problem:
·SERIN RX, T2400, ($0A), tag0, tag1, tag2, tag3, tag4, tag5, tag6, tag7, tag8, tag9
(This is also what is recommended in the nuts and volts article #120 provided on the same page)
·
·· I am using the parallax rfid reader to read the values from cards.· So far I have gotten good results.· I'd like to see the card values as hex characters in the debug terminal.· I looked up hex printing in the Editor Developer system (v2.1)·and saw that the $ symbol should print bytes in hex.· This is not working with my BS1 (v1.4).· The help also mentions that % will print a byte in binary format.· This does work with my bs1.· Is there another character I should be using for hex printing?
Thanks,
Jon
PS - The RFID file for the BS1 provided on http://www.parallax.com/detail.asp?product_id=28140·contains an error.· The SERIN statements are broken onto multiple lines which causes unpredictable reads in the bs1.· Condensing the SERIN lines to one line, like this fixes the problem:
·SERIN RX, T2400, ($0A), tag0, tag1, tag2, tag3, tag4, tag5, tag6, tag7, tag8, tag9
(This is also what is recommended in the nuts and volts article #120 provided on the same page)
·
Comments
Are you using the '{$STAMP BS1} compiler directive in the beginning of your program?
Regards,
Bruce Bates
· DEBUG #$myValue
The # indicates debugging the value only (sans name), the $ tells it to do so in hex.
Unfortunately, the RFID program for the BS1 does not have enough variables to create a subroutine that would duplicate the BS2's HEX2 modifier.· You could simply put a "." between RFID bytes to separate them.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
For what I am doing right now, I am only trying to get the Hex output to work in a DEBUG statement.· Currently it is not working.··In my·DEBUG statements,·#% works fine, but the #$ is printing the variable name (as in printing "$tag0" to the DEBUG console).· What am I doing wrong?· Is my BS1 (v1.4) too old for printing hex DEBUG statements?
Jon Williams - did you notice the PS in my first post?
Thank You,
Jon G.