neither of daves options works for me, I might be imagining the input differently
I have a hex serial 15 byte data stream in a byte array.
would need 30 bytes and could be parsed using serin2 ...[hex3 dw[0],hex3 dw[1] .......
I assume a input constructed like this,
ie 15 binary values in this order ,
arraywrite inbuff ,[$ED,$1E,$D2,$EF,$2E,$D3,$ED,$2E,$D2,$EF,$2E,$D3,$E D,$1E,$D2]
this does work
Code:
Pause 500 ' LCD initialize time
lcdout $FE,1
inbuff var byte[15]
dataword var word[10]
d var byte
INPOINTER VAR BYTE
outpointer var byte
arraywrite inbuff ,[$ED,$1E,$D2,$EF,$2E,$D3,$ED,$2E,$D2,$EF,$2E,$D3,$ED,$1E,$D2]
for d=0 to 4
dataword[d*2]=inbuff[d*3]*16+inbuff[d*3+1]>>4
dataword[d*2+1]=inbuff[d*3+2]+(inbuff[d*3+1]&$f)*256
next
for d=0 to 4
IF D=4 THEN
lcdout $FE,$80+d*4,hex3 dataword[d*2]
lcdout $FE,$c0+d*4,hex3 dataword[d*2+1]
ELSE
lcdout $FE,$80+d*4,hex3 dataword[d*2],","
lcdout $FE,$c0+d*4,hex3 dataword[d*2+1],","
ENDIF
next
Bookmarks