|
Re: Strange gear tooth sensor port issue
WPILib's "GetGTSensor" routine, from the latest release of WPILib.
The code is simply this:
void main(void) {
StartGTSensor(1, 0);
StartGTSensor(2, 0);
while (1) {
printf("1: %d 2: %d 3: %d 4: %d\n", GetGTSensor(1), GetGTSensor(2), GetGTSensor(3), GetGTSensor(4));
}
}
The gear tooth sensors are plugged into ports 1 and 2.
Output:
1: 0 2: <port 1 output> 3: 0 4: <port 2 output>
...
If I invert instead:
StartGTSensor(1, -1);
StartGTSensor(2, -1);
then I see this:
1: -1 2: <port 1 output> 3: -1 4: <port 2 output>
...
Regards,
-scott
|