Let me caveat this by saying I am a schlub and forgot to look and find out what version
of PBP I am running currently. I just received the upgrade disk for 2.60 yesterday, and will take it to work next week.
Here is a snippet of one of the variations of the code I have tried:
Code:
sd_tran VAR portC.6
sd_receive VAR portC.7
hexout VAR BYTE[4]
one VAR hexout[0]
two VAR hexout[1]
three VAR hexout[2]
four VAR hexout[3]
mainloop:
serout2 sd_tran, 32, ["C", 13, 10]
pause 200
serin2 sd_receive, 32, [hexout]
pause 200
LCDOUT $fe, 1, HEX one, HEX two, HEX three, HEX four
PAUSE 500
GOTO mainloop
END
What I get displayed on the LCD looks something like this 5F 00 00 00
What I am trying to do is display the actual hex string of characters that I get back from
the sensor. When connected to the computer via a terminal window, I usually get back something like "7AF", the last character is an ASCII "10" which get's dropped in the terminal window because it is a line feed. What I would like to display would be the whole four byte string, like "7AFA". Once I can do that, I know I can do the math to be able to get my angular number. I know it is a matter of telling PBP which bytes to to receive, store, retreive and display, but the correct way to do that is eluding me at the moment. I've tried various combination's of the SERIN2, LCDOUT, and BYTE or WORD variable to no avail. I keep getting very unlikely numbers.
Any assistance would be greatly appreciated.
Bookmarks