scottanderson
01-02-2008, 00:22
After a battle with a broken gear tooth sensor, we finally have two sensors working. Good.
We're using MPLab and WPILib, which is nice. However, the problem is that the GetGTSensor code doesn't seem to work as advertised.
The sensors are on ports 1 and 2 of the digital inputs. StartGTSensor(1,0) and StartGTSensor(2,0) work.
However (and this is the weird bit), the values for GT 1 must be retrieved with GetGTSensor(2) and the values for GT 2 must be retrieved with GetGTSensor(4).
Even odder, if StartGTSensor is used with an invert value of 1, GetGTSensor(1) will return -1 once the gear on port 1 starts moving, and GetGTSensor(3) will return -1 once the gear on port 2 starts moving.
What's going on here?
Regards,
-scott
We're using MPLab and WPILib, which is nice. However, the problem is that the GetGTSensor code doesn't seem to work as advertised.
The sensors are on ports 1 and 2 of the digital inputs. StartGTSensor(1,0) and StartGTSensor(2,0) work.
However (and this is the weird bit), the values for GT 1 must be retrieved with GetGTSensor(2) and the values for GT 2 must be retrieved with GetGTSensor(4).
Even odder, if StartGTSensor is used with an invert value of 1, GetGTSensor(1) will return -1 once the gear on port 1 starts moving, and GetGTSensor(3) will return -1 once the gear on port 2 starts moving.
What's going on here?
Regards,
-scott