View Single Post
  #1   Spotlight this post!  
Unread 30-03-2012, 21:13
Mk.32's Avatar
Mk.32 Mk.32 is offline
Registered User
AKA: Mark
FRC #2485 (W.A.R. Lords)
Team Role: Engineer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: San Diego
Posts: 770
Mk.32 has much to be proud ofMk.32 has much to be proud ofMk.32 has much to be proud ofMk.32 has much to be proud ofMk.32 has much to be proud ofMk.32 has much to be proud ofMk.32 has much to be proud ofMk.32 has much to be proud ofMk.32 has much to be proud ofMk.32 has much to be proud of
Custom GetRate not working.

Hi all,

We've heard that the WIPlib Encoder method getRate() is inconsistent, so we're trying to write out our own (better) without any success. Any suggestions?

Code:

private static double currGet = 0.0;

public static double getRate() {
double prevGet = currGet;
currGet = shooterEncoder.get();
int scalar = 50;
double rateDegreePerSec = Math.abs(currGet-prevGet)*scalar;

double rpm = rateDegreePerSec/6.0;
System.out.println("Rate: " + rpm);

return rpm;
}
__________________
Engineering mentor: Team 2485: WARLords 2013-

Team President: Team 3647 2010-2013

Last edited by Mk.32 : 30-03-2012 at 23:52.
Reply With Quote