Quote:
Originally Posted by 987HighRoller
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.