View Single Post
  #1   Spotlight this post!  
Unread 29-01-2017, 11:10
MuskieProgramme MuskieProgramme is offline
Registered User
FRC #6420
Team Role: Programmer
 
Join Date: Dec 2016
Rookie Year: 2014
Location: Muscatine, IA
Posts: 36
MuskieProgramme is an unknown quantity at this point
Encoders aren't working?

We are using the EVO Shifter with [url="http://www.andymark.com/E4T-OEM-Miniature-Optical-Encoder-Kit-p/am-3132.htm"]E4T OEM Optical Encoders[/ur]. We've wired them to DIO 0-3 on the RIO. The power, ground, and A channel are wired to port 0 / 2 and the B channel is wired to port 1 / 3.

In our code, we are using them like this:
Code:
//RobotMap.java init()
rightDriveEncoder = new Encoder( 0, 1 );
Code:
//DriveWithJoystick.java execute()
SmartDashboard.putString("DB/String 0", "" + RobotMap.rightDriveEncoder.getRate() );
However, the dashboard *always* shows 0.0, no matter what we do. We have verified that the encoder is turning. If we change this to display DigitalInput for port 0, it always displays true.

Have we wired it incorrectly or is there something we should be doing in the code?
Reply With Quote