I’m trying to use a gear tooth sensor with easy c. When I use the default gear tooth sensor functions I don’t get any readings from our sensor. But when I use the GetDigitalInput function, I get a reading from the sensor? Why would this be?
I don’t know much about easy C program, but I know that easy C does not give exact code we need. So, try look at Kevin Watsons encoder code and find how gear tooth sensor works. Than, try to combine or copy Kevin Watson’s code to easy C.
If you are getting digital input, that is great. Because gear tooth sensor gives digital input. All you have to do is convert the data to analog and find the right parameter.
I’m not familiar with easyC (being a user of mplab), but maybe the gear tooth sensor functions rely on some particular digital input and you have it connected to a different one. Also, check for any configuration information, or perhaps calibration… just a guess.
Sorry for the late reply. Maybe you have already figured it out since your post but I have set up the gear tooth sensor successfully with the easyC default code. The sensor returns an absolute value based on the number of times it senses a gear tooth passing by. So, all you need to do is create a variable of type “int”, assign it the value from the GetGTSensor() function, and display the value of the variable with a screen print.