grasshopper
05-15-2008, 09:57 PM
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 "[TT S 30]" I get the correct data i just can not add The_STring [ 9 ] and The_ STring [ 10 ] which are 3 and 0 in "[TT S 30]"
IF (The_STring [ 4 ] == $54) AND (The_STring [ 5 ] == $54) AND (The_STring [ 6 ] == $20) AND (The_STring [ 7 ] == $53)
NUMBERS := (The_STring [ 9 ] + The_STring [ 10 ] ' This is the array containing the numbers
SER.STR(STRING("[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
If i send the command through the serial port "[TT S 30]" I get the correct data i just can not add The_STring [ 9 ] and The_ STring [ 10 ] which are 3 and 0 in "[TT S 30]"
IF (The_STring [ 4 ] == $54) AND (The_STring [ 5 ] == $54) AND (The_STring [ 6 ] == $20) AND (The_STring [ 7 ] == $53)
NUMBERS := (The_STring [ 9 ] + The_STring [ 10 ] ' This is the array containing the numbers
SER.STR(STRING("[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