PDA

View Full Version : Hserin Array Question



Hylan
- 8th May 2012, 22:11
I just started to test out using Hserin.

I first did a test using

Hserin [dec Data]
if Data > 1 then
LED = 1
else
LED = 0
endif

This was just to make sure everything was communicating and it was. Now on to the real data.
The data string I want to send is at minimum 23 characters but can be longer (24 for a full 3 bytes) if necessary.
The data package will look like this:
“12345678_12_34_87654321”
I’m using the command
Hserin [str RxDATA\23]
‘RxDATA is defined as
RxDATA var byte[3]
Now my problem is how to breakdown the array into
RxDATA1 = 12345678
RxDATA2 = 12
RXDATA3 = 34
RxDATA4 = 87654321
I’m guessing I have multiple issues going on here so any guidance is appreciated.
Thank you,
Hylan

Hylan
- 9th May 2012, 02:39
Okay, so I think I was over thinking this a bit. I'm able to switch my RxDATA1 & 4 to binary so now I can just use:
hserin [bin RxDATA1, skip 1, dec RxDATA2, dec RxDATA3, bin RxDATA4]
This seems to work pretty well