View Single Post
  #5   Spotlight this post!  
Unread 23-07-2012, 09:27
badtkee badtkee is offline
Registered User
no team
 
Join Date: Jun 2012
Location: Green Bay
Posts: 20
badtkee is an unknown quantity at this point
Re: Help with Speed control using Cortex and US Digital Encoders

No worries I'm just greatful for the help. So a lot of this makes sense to me now. I am starting to see how this all works.

Now that I have the speed. To make it go a certain distance I would put the PID code into a while loop and this would keep looping until the encoders reach a certain distance kinda like this:

while (SensorValue[leftEncoder] < distance)
{
PID();

}

where PID() is similar to the example code you supplied, and distance is specified by the user. Is this right?
__________________
--Eric