View Single Post
  #2   Spotlight this post!  
Unread 11-02-2005, 23:05
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
Re: Accelerometer Timer Question

Quote:
Originally Posted by psquared
I am looking over the accelerometer code tonight, this way when i go in to program tomorrow, I'll be able to get started right away. I was looking over Kevin Watson's accelerometer code and I think I am understanding it, but I had a few questions.

The void Timer_2_Int_Handler is what contains all of the code to actually calculate the current acceleration of the robot, and update that acceleration. (I hope I am right here, otherwise i think im gonna be in trouble ) The void information says that it is called from user_routines_fast.c/InterruptHandlerLow(). This is where I am confused. Since we initialize the accelerometer with Initialize_Timer_2 which says it starts the timer, do I have to call this void (Timer_2_Int_Handler) in my user_routines.c or will it be automatically called. The reason why I am curious is b/c in the _fast.c code it shows the Timer_2_Int_Handler, but the _routines.c code is able to use the Get_Acceleration function and that stops the timer and returns the current acceleration, but how can Get_Acceleration work if i don't call Timer_2_Int_Handler in _routines.c.
I hope i was clear in my confusion, sorry if i wasn't.
So in short, do i need to call Timer_2_int_Hanlder in my user_routines.c code...
Do you have to look at an alarm clock for it to ring? No. It goes off when you tell it to. So does an interrupt... You do not call it.
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...