Go to Post Gracious professionalism is a two-way street. - Bharat Nain [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 11-02-2005, 22:58
psquared psquared is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Chantilly
Posts: 34
psquared is an unknown quantity at this point
Accelerometer Timer Question

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, or does the timer do it, and therefore all i need to do is call the get_acceleration?

Thanks for help with that question, and sorry if i made it more confusing then it was.

My other question deals with what analog port the code specifies for the accelerometer. I think it is the first analog port? Also how would I change the accelerometer.c code to change the port?

Thanks (in advance) for helping us out.
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Example accelerometer code released. Kevin Watson Programming 0 20-01-2005 03:45
Question of the Week!!! (7/19/04) Andy Grady General Forum 23 23-07-2004 13:21
Question of the Week!!! (6/14/04) Andy Grady General Forum 23 01-07-2004 15:54
Timer interrupt hic-cupping - HELP roknjohn Programming 9 15-03-2004 17:56
Interrupt timer, executing code asap? SeanCassidy Programming 10 07-03-2004 01:47


All times are GMT -5. The time now is 16:51.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi