Go to Post Much of what you do in the "real world" has no rules. You have to look yourself in the mirror and make them up as you live; knowing that what you do WILL come back to haunt you sooner or later. - dhitchco [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 13-02-2011, 16:50
pureinit pureinit is offline
Registered User
FRC #3506
 
Join Date: Feb 2011
Location: Charlotte, NC
Posts: 1
pureinit is an unknown quantity at this point
Encoder Instance

Our team is programming in Java, and we can't find out how to create a proper instance of an encoder. We looked at the constructor method for Encoder, and it needs a boolean. However, when we put 'true' or 'false' in, we kept producing an error. The code looks sort of like this:

rfEncoder = new Encoder(true, 5);


since this isn't working, what should we do instead?
Reply With Quote
  #2   Spotlight this post!  
Unread 13-02-2011, 17:02
lusterlink's Avatar
lusterlink lusterlink is offline
Registered User
FRC #1160 (FireBird Robotics)
Team Role: Programmer
 
Join Date: Aug 2010
Rookie Year: 2009
Location: USA
Posts: 9
lusterlink is an unknown quantity at this point
Re: Encoder Instance

Quote:
Originally Posted by pureinit View Post
Our team is programming in Java, and we can't find out how to create a proper instance of an encoder. We looked at the constructor method for Encoder, and it needs a boolean. However, when we put 'true' or 'false' in, we kept producing an error. The code looks sort of like this:

rfEncoder = new Encoder(true, 5);


since this isn't working, what should we do instead?
I've looked through the javadocs, and the only boolean you would ever need to pass the constructor would be for the reverseDirection. Eg. Below.

Encoder(int aChannel, int bChannel, boolean reverseDirection)

Are you sure your looking at the Encoders in the Java 2011 Javadocs? I can't think of another reason why the javadocs you're looking at simply calls for two arguments, one of which is a boolean.

Are you trying to program the magnetic encoders or the quad us Digital ones? I only have experience with the USDigital ones, with them you need two digital inputs for them to function correctly.

Edit:

Noticed you mentioned that the code look sort of like that. Could you post the exact line your writing?
__________________

Last edited by lusterlink : 13-02-2011 at 17:10.
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 22:19.

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