View Single Post
  #4   Spotlight this post!  
Unread 15-03-2007, 23:17
Jake M Jake M is offline
void* Jake;
FRC #1178 (DURT)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Missouri
Posts: 118
Jake M has a spectacular aura aboutJake M has a spectacular aura about
Re: Anyone actually using hardware timers?

If you just to designate the arm to move to certain positions at a certain time, just in autonomous mode, you don't need to use the timer. In 2005, we had a 3 point autonomous by just doing something like this....

Code:
Autonomous_Mode(void)
 {
  static int timer = 0;

  if(timer == 20)
    move arm up;
  else if(timer == 40)
    move forward;
  else if(timer == 60)
    drop arm;

  ++ timer;
 }
Surprisingly, we didn't even overflow once within the 15 second autonomous. Those may not have been the exact values we used, but they pretty low. I think the first two were under 100.
__________________
Code:
void function(void)
 {
  function();
 }

Last edited by Jake M : 15-03-2007 at 23:20.