View Single Post
  #5   Spotlight this post!  
Unread 31-01-2011, 12:14
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: Encoder setDistancePerPulse()

Quote:
Originally Posted by el-zoroo View Post
We had this same problem too. The quick fix appears to be to construct the Encoder with a 2x encoding type, i.e.
Code:
//Assuming Encoder is connected to DIO 1 and 2 and not reversed
Encoder sensor = new Encoder(1,2,false,CounterBase.EncodingType.k2x)
I do not know if it is a bug with the WPILib. Maybe someone else can confirm.

Hope that helps!
This definitely helps, but i get weird numbers like 0.0.0054465 and .00045678
Any idea what it means?

UPDATE
nvm, I did a powercycle and i got better numbers
what are the units the encoder returns?
__________________

Last edited by kinganu123 : 31-01-2011 at 12:32.
Reply With Quote