Quote:
Originally Posted by scottanderson
Code:
printf("1: %d 2: %d 3: %d 4: %d\n", GetGTSensor(1), GetGTSensor(2), GetGTSensor(3), GetGTSensor(4));
|
The problem is probably with the
printf() statement, not with the Gear Tooth Sensor code. You're asking for four
ints to be printed. It looks like
GetGTSensor() returns a
long. The first
%d will show the first 16 bits of
GetGTSensor(1), the second
%d will show the rest of
GetGTSensor(1), the third will show the first 16 bits of
GetGTSensor(2), etc.
If this is the case, you can correct the problem either by printing the values using
%ld, or by casting them as
(int).