View Single Post
  #1   Spotlight this post!  
Unread 12-02-2009, 21:32
robself705's Avatar
robself705 robself705 is offline
Team Leader / Mechanical
AKA: Rob Self
FRC #0706 (Cyberhawks)
Team Role: Mechanical
 
Join Date: Nov 2008
Rookie Year: 2009
Location: Arrowhead High School Wisconsin
Posts: 72
robself705 is a name known to allrobself705 is a name known to allrobself705 is a name known to allrobself705 is a name known to allrobself705 is a name known to allrobself705 is a name known to all
problems with multiple encoders, please help!

we're using a total of 4 encoders on our robot, 2 for steering, and 1 for a turret. but when any more than 1 encoder is defined, only the one that is defined first works. here is a sample of some code that only read one of the encoders in teleoperated mode

Encoder front(1,2);
Encoder back(3,4);

while (1)
{
printf("%d %d\n", front.Get(), back.Get());
}

front.Get gives back a value when we turn the encoder but back.get does not, we've checked the wiring a hundred times, any help would be greatly appreciated