nanovm.nibo.drivers
Class WheelEncoder

java.lang.Object
  extended by nanovm.nibo.drivers.WheelEncoder

public class WheelEncoder
extends java.lang.Object

Encapsulates the information about the wheels rotation. You will have to call the update Method first to get actual values. All wheel encoder information is given in ticks, a tick is 1/20 of a whole rotation.


Field Summary
static int MAXIMUM
          maximum value for tick increment
static int MAXIMUM_SPEED
          minimum value for speed
static int MINIMUM
          minimum value for tick increment
static int MINIMUM_SPEED
          maximum value for speed
 
Constructor Summary
WheelEncoder()
           
 
Method Summary
static boolean getEnabled()
          get status of wheel-encoder
static int getLeftInc()
          get tick-count from left wheel since last call
static int getLeftSpeed()
          get actual speed (ticks/second) from left wheel
static int getRightInc()
          get tick-count from right wheel since last call
static int getRightSpeed()
          get actual speed (ticks/second) from right wheel
static void setEnabled(boolean enable)
          enable and disable the wheel-encoder
static void update()
          update wheelencoder data
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAXIMUM

public static final int MAXIMUM
maximum value for tick increment

See Also:
Constant Field Values

MINIMUM

public static final int MINIMUM
minimum value for tick increment

See Also:
Constant Field Values

MAXIMUM_SPEED

public static final int MAXIMUM_SPEED
minimum value for speed

See Also:
Constant Field Values

MINIMUM_SPEED

public static final int MINIMUM_SPEED
maximum value for speed

See Also:
Constant Field Values
Constructor Detail

WheelEncoder

public WheelEncoder()
Method Detail

update

public static void update()
update wheelencoder data


getLeftInc

public static int getLeftInc()
get tick-count from left wheel since last call

Returns:
ticks since last call

getRightInc

public static int getRightInc()
get tick-count from right wheel since last call

Returns:
ticks since last call

getLeftSpeed

public static int getLeftSpeed()
get actual speed (ticks/second) from left wheel

Returns:
ticks per second

getRightSpeed

public static int getRightSpeed()
get actual speed (ticks/second) from right wheel

Returns:
ticks per second

setEnabled

public static void setEnabled(boolean enable)
enable and disable the wheel-encoder

Parameters:
enable - true for enable

getEnabled

public static boolean getEnabled()
get status of wheel-encoder

Returns:
true when enabled