|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#3
|
||||
|
||||
|
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; |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help with MPLAB | burningpig | Programming | 9 | 17-01-2007 13:10 |
| Kevin Watson and programming VEX in MPLAB | Doug Leppard | Programming | 4 | 24-08-2006 21:05 |
| Vex Programming with MPLAB and IF loader | Joohoo | Programming | 3 | 27-07-2006 18:18 |
| VEX UltraSonic and Encoder SOLD OUT... | Chris_Elston | Electrical | 5 | 09-01-2006 13:22 |
| Need Help with Encoder - Won't Count Clicks | Kingofl337 | Programming | 5 | 16-02-2005 18:30 |