View Single Post
  #5   Spotlight this post!  
Unread 24-10-2007, 21:18
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Problem using VEX shaft encoder

I'm having some trouble with the VEX shaft encoders as well... I think it's a hardware related problem, but here is the code I'm using to count the ticks:

Code:
if (rc_dig_int1 != left)
{
left = rc_dig_int1;
leftoptenc = 1 + leftoptenc;
}
if (rc_dig_int2 != right)
{
right = rc_dig_int2;
rightoptenc = 1 + rightoptenc;
}
It all sort of works, but even when I have both shafts tied together, the values will jump back and forth by 10, and if I leave it for a while, hundreds, although both have had the same amount of revolutions.
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364