If vservo1 ends up being greater than 65,524, then vservo1 + 12 = 65536, which in a WORD variable ends up equalling ZERO...Code:if vservo1pos=>vservo1+12 then
If vservo1 ends up being greater than 65,524, then vservo1 + 12 = 65536, which in a WORD variable ends up equalling ZERO...Code:if vservo1pos=>vservo1+12 then
vServo1 is a byte and cant go above 255.
I will try declaring cServoOffTime as a variable instead. I think something similar to this was the reason for my thread about the datatypes of constants
That doesnt seem to work either.
I just tried removing the constant completely and putting the value into the middle of the code and that works :S. I dont like doing that but in this case i dont really have a choice. The only problem now is the other line. vServo1 gets set by data from the serial port so i cant write the value into the code
Bookmarks