View Single Post
  #22   Spotlight this post!  
Unread 17-01-2007, 21:08
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Gear Tooth Sensor

Quote:
Originally Posted by 987HighRoller View Post
Ok, I'm having problems with the gear tooth sensor. I have the sensor wired up correctly and everything, but when I print the value of the digital port, it stays at 0.
I know you said you wired it correctly, but that's still the first place to start. What do you have connected to the six connection points on the sensor?

Have you configured the port as an input? You probably didn't need to do anything special, because the default code sets all digital pins to inputs in User_Initialization().

How exactly are you printing the value? Show us the line of code that you're using.

Once we've determined that you can indeed read the state of the input pin, you're only half finished. Unless you intend to monitor a gear that has only a few teeth going by per second, you will almost certainly need to use interrupts in order to count gear teeth reliably.