Go to Post [Programming a swerve drive] It's really really simple, unless you actually do it. - Ether [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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
  #1   Spotlight this post!  
Unread 18-01-2012, 18:34
Secretspy97 Secretspy97 is offline
Registered User
FRC #1126
Team Role: Programmer
 
Join Date: Oct 2011
Rookie Year: 2009
Location: New York
Posts: 25
Secretspy97 is an unknown quantity at this point
2012 crio II encoder java constructor

We purchased a new 4 slot crio to test for this year. During our testing we installed a digital sidecar in slot number 2. Then we plugged an encoder into dio ports 1 and 2. We tried to read from the encoder by constructing it the following way:

shooterSpeed = new Encoder( 2, 1, 2, 2, true, Encoder.EncodingType.k4X)

This constructor takes slot, port, slot, port, ... So we specified slot 2 port 1 slot 2 port 2. This didn't seem to work. All readings were 0.

During our debug we decided to try specifying slot 1 instead of slot 2. Suddenly the encoder began to function.

shooterSpeed = new Encoder( 1, 1, 1, 2, true, Encoder.EncodingType.k4X);

Has anyone else experienced something like this? This is pretty strange because slot 1 has the analog breakout plugged in to it.
Reply With Quote
 


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


All times are GMT -5. The time now is 11:29.

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