nanovm.nibo.drivers
Class Motor

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

public class Motor
extends java.lang.Object

Provides methods for the motor controll. All speed information has to be given in ticks, a tick is 1/20 of a whole rotation. see Nibo Wiki for details.


Field Summary
static int MAXIMUM_PWM
           
static int MAXIMUM_SPEED
           
static int MINIMUM_PWM
           
static int MINIMUM_SPEED
           
 
Constructor Summary
Motor()
           
 
Method Summary
static void setParameters(int p, int i, int d)
          Set the parameters for the motor control algorithm.
static void setPWM(int left, int right)
          Bypass the motor controller and set the PWM values directly.
static void setSpeed(int left, int right)
          Set the target speed for the motor controller.
static void stop()
          Stop all motor activity immediatly.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAXIMUM_PWM

public static final int MAXIMUM_PWM
See Also:
Constant Field Values

MINIMUM_PWM

public static final int MINIMUM_PWM
See Also:
Constant Field Values

MAXIMUM_SPEED

public static final int MAXIMUM_SPEED
See Also:
Constant Field Values

MINIMUM_SPEED

public static final int MINIMUM_SPEED
See Also:
Constant Field Values
Constructor Detail

Motor

public Motor()
Method Detail

setParameters

public static void setParameters(int p,
                                 int i,
                                 int d)
Set the parameters for the motor control algorithm.

Parameters:
p - proportional factor
i - integral factor
d - differential factor

setPWM

public static void setPWM(int left,
                          int right)
Bypass the motor controller and set the PWM values directly.

Parameters:
left - pwm value for the left motor
right - pwm value for the right motor

setSpeed

public static void setSpeed(int left,
                            int right)
Set the target speed for the motor controller.

Parameters:
left - target speed for the left motor in ticks per second
right - target speed for the right motor in ticks per second

stop

public static void stop()
Stop all motor activity immediatly.