Convert Word To Number
kenwtn
Posts: 250
Can someone tell me how to convert a WORD to a number so it can be used in calculations? The problem I am having is when I use the sample code that comes with Parallax’s compass it defines angle as a word and when displayed in DEBUG you use DEBUG DEC angle, but if you use DEBUG angle you get junk. Can anyone help me out?
Comments
· Thanks, but how do get into say 90 degrees so I can test it. Like
IF angle = 90 THEN
·· do something
ENDIF
testA = angle + 5
DEBUG DEC testA
Most of the time I get a number that is plus 5 but at times I get a number like 994
On your second problem ... You didn't say where you got the original angle value or what it was. I think you'll find that the + 5 worked fine if you account for the original value.
· Thanks as always you are a good source. If found my problem and got it fixed. I do have yet another question. After I calabrated the compass I get about a 18 degree swing in the readings is that normal?