Go to Post If it looks like an appendage, quacks like an appendage and moves like an appendage...it is an appendage... - Bob Steele [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 02-18-2014, 11:18 PM
4239 Mack 4239 Mack is offline
Registered User
FRC #4239
 
Join Date: Feb 2014
Location: Minnesota
Posts: 4
4239 Mack is an unknown quantity at this point
Help with Encoder

We are using an encoder for the first time on our robot. Whenever we try to use it or declare it our robot doesnt work.

Code:
Encoder encoder = new Encoder(3, 4);
That is what we are using for the encoder and to get the values we are using.
Code:
encoder.get();
Can anyone help us set this up or provide a detailed tutorial for using an encoder in java?

EDIT: we have also tried using this.
Code:
Encoder encoder = new Encoder(3,4,false,EncodingType.k4x);
Reply With Quote
  #2   Spotlight this post!  
Unread 02-18-2014, 11:38 PM
MagiChau's Avatar
MagiChau MagiChau is offline
Registered User
AKA: Michael Chau
FRC #0085 (B.O.B. (Built on Brains))
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Zeeland, Michigan
Posts: 875
MagiChau is just really niceMagiChau is just really niceMagiChau is just really niceMagiChau is just really nice
Re: Help with Encoder

Can you give error outputs or describe what values you are getting from encoder.get()? your initialization of the encoder seems to be fine.
Reply With Quote
  #3   Spotlight this post!  
Unread 02-18-2014, 11:47 PM
4239 Mack 4239 Mack is offline
Registered User
FRC #4239
 
Join Date: Feb 2014
Location: Minnesota
Posts: 4
4239 Mack is an unknown quantity at this point
Re: Help with Encoder

We don't get any erros and the output we get is 0 no matter how much we rotate the pole its attached too
Reply With Quote
  #4   Spotlight this post!  
Unread 02-18-2014, 11:53 PM
MichaelB MichaelB is offline
Registered User
FRC #3573 (The Ohms)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2011
Location: Conyers
Posts: 8
MichaelB is an unknown quantity at this point
Re: Help with Encoder

Between the first two bits of code you need to have encoder.start() somewhere.
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 09:03 AM.

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