View Single Post
  #8   Spotlight this post!  
Unread 30-01-2005, 12:25
Salik Syed Salik Syed is offline
Registered User
FRC #0701 (RoboVikes)
Team Role: Alumni
 
Join Date: Jan 2003
Rookie Year: 2001
Location: Stanford CA.
Posts: 514
Salik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud of
Send a message via AIM to Salik Syed
Re: Hall Sensor working?

all you need to do is set the counting part of your program in user_routines_fast.c this is plenty fast enough... no need for interupts... (we didn't need them....) it counted almost everytooth on the last stage gear in the stock tranny running at full speed....

for the code do something really simple like

Code:
////in variables section
int numteeth=0; //num of teeth
int lastreading=0;

/// in code
if((rc_dig_in01-lastreading)!=0)  // if the value of the sensor changes then......
{
numteeth++;  // add one to teeth count....
}
lastreading=rc_dig_in01;
also this will count from going from the valley before the tooth to the tooth and then from the tooth to the valley after the tooth... so the tooth count will be double ... but this is better...more resolution (half a tooth is more resolution than you can use anyways!)
__________________
Team 701