I read a string from serial port. Each byte of the string represents device status.
If I do it this way it works fine:
int status
covx u[0],va3.txt,0,0
covx va3.txt,status,0,0
n1.val=status
covx u[1],va3.txt,0,0
covx va3.txt,status,0,0
n2.val=status
ucopy status,0,1,0
n3.val=status
ucopy status,1,1,0
n4.val=status
For example if the string send is “123”, I get results in
n1 49, n2 50
n3 49, n4 50
Note, the sting bytes can have any value from 0 to 129.
But the problem is that I want to store this string in the variable and access the different byte of this string depending on the displayed page.
I tried this code but it doesn’t work:
ucopy va3.txt,0,3,0
substr va3.txt,va4.txt,0,1
covx va4.txt,status,0,0
n5.val=status
for the same string as in the example above “123”, I get n5 1 not 49.
If the string is “abc” n5 is 0
How can I do it?
It is amazing that basic operation on the bytes/unsigned char is not available.