View Single Post
  #8   Spotlight this post!  
Unread 04-02-2009, 10:14
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,563
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: analog input help

Quote:
Originally Posted by IceStorm View Post
We weren't necessarily trying to get it to count up and down as long as we were able to get it to count 1 direction and have the ability to reset the count when the direction changes would have worked as well for us.
You could use the falling output from the analog trigger to reset the counter.

Quote:
Originally Posted by IceStorm View Post
It looks pretty straight forward other than we will need to adjust our high and low triggers and I'm not sure (with only looking at the code for a few seconds) what type of value in need to put in for Max RPS.
The analog triggers are susceptible to noise on the analog inputs. One way to combat this is to enable averaging of the analog inputs. However, if you average too much, you'll miss transitions. If you put in the Maximum Reveolutions Per Second (or in your case transitions per second) that the sensor will see, the library I wrote will calculate the right amount of averaging for maximum noise rejection and still catch all transitions. You can also help it by making sure a very high sample rate is used for the analog module.
Reply With Quote