View Single Post
  #5   Spotlight this post!  
Unread 19-03-2008, 20:36
Glueeater Glueeater is offline
Registered User
no team
 
Join Date: Mar 2008
Rookie Year: 2007
Location: The Hood
Posts: 8
Glueeater is an unknown quantity at this point
Re: Controlling Motors More Accurately

I have sorted the problem out somewhat. Is there a way to limit a range of numbers? Such as:

Code:
If (rps < trps)
speed = speed + 1

elseif (rps > trps)
speed = speed - 1

elseif (rps == trps)
speed = speed
I want to keep it only in forward motion so the values must be restricted to 127 to 255. Thank you!