Go to Post We are customers to FIRST. In that comes expectations. I don't want to hear another, "You should be grateful for everything FIRST does" nonsense when FIRST royally screws up. - MikeDubreuil [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

 
Reply
Thread Tools Rate Thread Display Modes
  #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
  #2   Spotlight this post!  
Unread 18-01-2012, 21:50
kinganu123 kinganu123 is offline
Registered User
FRC #1747
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Piscataway, NJ
Posts: 243
kinganu123 is on a distinguished road
Re: 2012 crio II encoder java constructor

I think there was a bug last year, can't exactly remember, but you may have to use Encoder.EncodingType.k2X or write your own Encoder.EncodingType.k4X
__________________
Reply With Quote
  #3   Spotlight this post!  
Unread 18-01-2012, 21:56
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: 2012 crio II encoder java constructor

Check the wiring. We were trying to debug the encoders for like 2 weeks because of faulty wiring.
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.
Reply With Quote
  #4   Spotlight this post!  
Unread 18-01-2012, 22:10
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,572
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: 2012 crio II encoder java constructor

Quote:
Originally Posted by Secretspy97 View Post
Has anyone else experienced something like this? This is pretty strange because slot 1 has the analog breakout plugged in to it.
This is how it is supposed to work from now on. It no longer references slot number, but references which module. The first digital module (in slot 2 of both cRIOs) is 1. The second digital module (in slot 4 of the new cRIO or slot 6 of the old cRIO) is 2. This is so you don't have to change your code to switch between cRIOs.

Quote:
Originally Posted by kinganu123 View Post
I think there was a bug last year, can't exactly remember, but you may have to use Encoder.EncodingType.k2X or write your own Encoder.EncodingType.k4X
The bug you are probably thinking of had to do with the rate output, and would be unrelated to this problem. It was also fixed this year.

Last edited by Joe Ross : 18-01-2012 at 22:12.
Reply With Quote
Reply


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 13:23.

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