Go to Post One key, esspecialy for newer teams, is to understand that the game rule book and design requirements are requirements, not suggestions. - Chris Fultz [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Spotlight this post!  
Unread 10-03-2007, 05:24
UnderDark's Avatar
UnderDark UnderDark is offline
Alumni
AKA: Matthew Korzeniowski
FRC #0862 (Lightning Robotics)
Team Role: Alumni
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Canton, Michigan
Posts: 14
UnderDark will become famous soon enough
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
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 21:25.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi