
Re: Time tracking on pic microcontroller
Yes, this is possible using a component of ROBOTC called a
timer. You may want to read this wiki page:
http://www.robotc.net/wiki/VEX2_Functions_TimingHere's an example of how this could be done:
This assumes you have two subroutines called driveForward() and turn(), and that driveForward decides when to stop. At the end of the program, the time from starting to drive forward until the turn is stored in the variable timeUntilTurn.