|
Re: Encoder Help with VEX and MPLAB
The VEX encoders send a binary string. You should only increment distance when the latest value is different from the previous value.
Code:
unsigned int distance = 0;
char encOld = 0;
.
.
.
if((char)rc_dig_int1 != encOld)
distance++;
encOld = rc_dig_int1;
__________________
"My gaming is FIRST!"
-Joe Jagadics
"I am like an all powerful warloard"
-Brian Graham
|