Variable and array WITH serial com problem
grasshopper
Posts: 438
I am having a problem taking a few numbers from an array and adding them together. Once added i wanted to send back the number that should now be a variable. Problem is the number sent back is not the correct number.
If i send the command through the serial port "[noparse][[/noparse]TT S 30]" I get the correct data i just can not add The_STring [noparse][[/noparse] 9 ] and The_ STring [noparse][[/noparse] 10 ] which are 3 and 0 in "[noparse][[/noparse]TT S 30]"
P.s This line of code seems to work
Any help would be great ...
Post Edited (grasshopper) : 5/15/2008 3:36:53 PM GMT
If i send the command through the serial port "[noparse][[/noparse]TT S 30]" I get the correct data i just can not add The_STring [noparse][[/noparse] 9 ] and The_ STring [noparse][[/noparse] 10 ] which are 3 and 0 in "[noparse][[/noparse]TT S 30]"
IF (The_STring [noparse][[/noparse] 4 ] == $54) AND (The_STring [noparse][[/noparse] 5 ] == $54) AND (The_STring [noparse][[/noparse] 6 ] == $20) AND (The_STring [noparse][[/noparse] 7 ] == $53) NUMBERS := (The_STring [noparse][[/noparse] 9 ] + The_STring [noparse][[/noparse] 10 ] ' This is the array containing the numbers SER.STR(STRING("[noparse][[/noparse]THE NUMBER IS ")) ' Sending back the data SER.DEC(Numbers) ' The number SER.STR(STRING("]")) ' Ending bracket Com_PortA ' return to port A to look for more instructions
P.s This line of code seems to work
SER.hex(Numbers,4) ' The number
Any help would be great ...
Post Edited (grasshopper) : 5/15/2008 3:36:53 PM GMT
Comments
I may have a input of
Later i want to use negative numbers and a range from -100 to 200 so i will increase my array a bit.
Just needed to rethink the post you made!