View Single Post
  #1   Spotlight this post!  
Unread 01-29-2011, 08:57 PM
agentace agentace is offline
Registered User
FRC #2522
 
Join Date: Feb 2010
Location: Lynnwood High School
Posts: 8
agentace is an unknown quantity at this point
Java Encoder Problem

I am new to Java, but have a new mentor who is fluent in Java but not the FRC plugins. We have been trying to get the encoders to update their raw values on the Java debugging screen but have been only getting the output of 0.0. We know the encoders work because they work fine in LabVIEW, but not Java. This is the code I have so far:

private Encoder rightEncoder = new Encoder(4,5,4,6,true,CounterBase.EncodingType.k4X) ;
private Encoder leftEncoder = new Encoder(4,7,4,8,true,CounterBase.EncodingType.k4X) ;

and then in teleop periodic:

System.out.println(" le="+leftEncoder.get()
+" re="+rightEncoder.get());

Am I missing anything that would keep the encoders from posting the right values?

Thanks.

Pete
Team 2522
Reply With Quote