Quote:
Originally Posted by Keo-san
We are trying to use the KoP's Gear Tooth sensors.We wired the sensor and are trying to get imput from the sensor but I get a constant 1 which is "i don't see it" I was just using a simple if then from the rc_dig_in02. I tried interupts before but since I don't know how to use them I got nothing. So I need some help maybe something I'm doing wrong with the sensor.which way to mount it and program it eventually with interrupts.please help! I'll be counting sprocket teeth with this sensor
|
Hello-
This is how our team integrated and tested the GTS as supplied with the KoPs.
1) Download from Kevin's FRC site the latest encoder sample code.
2) Follow the instructions in the readme. Pay special attention to the part about updating the .h file.
3) Solder part of a PWM cable to the encoder as indicated in this post:
http://www.chiefdelphi.com/forums/sh...4&postcount=26
4) Test-compile Kevin's code to make sure you've got the appropriate files.
5) Hook up the GTS.
6) Download/run the program
7) Grab a pair of ferrous pliers. Tap the black/grey sensor head (you'll feel the magnetic pull) several times, swinging them back several inches. This simulates a 'tooth' moving into and out of the frame of the sensor.
8) If the counters don't work, try it on IO1, IO2, and IO3. For some reason our second sensor would only work on IO2.
9) If it STILL does not work, try a different sensor. Our (real) first one was 'dead' and never worked at all.
When you're done, if you're trying to integrate a number of different sensors, remember this post here for correct interrupt handling:
http://www.chiefdelphi.com/forums/sh...ad.php?t=53483