Thread: easyC trouble
View Single Post
  #11   Spotlight this post!  
Unread 22-01-2006, 03:16
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 588
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: easyC trouble

Quote:
Originally Posted by Erics626
Perhaps I should be more specific. We are trying to write a program for count wheel rotations. We want the left wheel to travel a different number of rotations than the right wheel. I created two different user functions, one for counting the left wheel and one for counting the right wheel. We implemented these functions into autonomous, but the wheels do not start at the same time. Instead, the left wheel goes the distance we set, and as soon as the left wheel is done, the right wheel begins to rotate and start its count.
I'm not sure exactly what you are really trying to do - sounds like making a turn using the wheel encoders. But to do literally what you asked for, you need to start both wheels going. Then in a loop, read each wheel count, and using two IF statements, stop each wheel when its count is greater than or equal to the count your are looking for.
That way the wheels will both be running at the same time and they will each stop independently after the correct number of rotations.
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute