Help, brain burnout here with Easyhid and words LOL
I want to send a Word value of decimal 1000
I am sending from VB two bytes of data 10 00:
BufferOut(0) = 0
BufferOut(1) = 10
BufferOut(2) = 00
In PBP I am receiving them fine as bytes
Byte1=usbbuffer(0)
Byte2=usbbuffer(1)
Now I want to pop these into a Word Value within PBP code but using
WordData.HighByte=Byte1
WordData.LowByte=Byte2
But it takes the value and stores then as Hex Byte1 gets stored as 0A and Byte 2 gets stored as 00 and hence when I end up with 2560 in Decimal stored and not 1000.
Now the question is, do I have to convert my Decimal 1000 to hex at the VB end and send or can I convert in my PBP code after receiving?.
If using Serial data and Receiving using Hserin I just simply
HSerin [WAIT("$"),DEC4 WordData]
And would love to do that with USB as well!
I am probs missing something so obvious here LOL
Regards
Sean.
Bookmarks