RoboJDETM v2.0

com.ridgesoft.robotics
Interface Motor

All Known Subinterfaces:
Motor2
All Known Implementing Classes:
ContinuousRotationServo, DevantechMD03

public interface Motor

Generic interface to a variable power motor.


Field Summary
static int MAX_FORWARD
          Maximum power in the forward direction.
static int MAX_REVERSE
          Maximum power in the reverse direction.
static int STOP
          Power off (coast and/or stop).
 
Method Summary
 void brake()
          Applies active braking if supported by the motor controller.
 void setPower(int power)
          Sets the motor's power.
 void stop()
          Turns the motor power off, allowing the motor to coast or stop.
 

Field Detail

MAX_FORWARD

static final int MAX_FORWARD
Maximum power in the forward direction.

See Also:
Constant Field Values

MAX_REVERSE

static final int MAX_REVERSE
Maximum power in the reverse direction.

See Also:
Constant Field Values

STOP

static final int STOP
Power off (coast and/or stop).

See Also:
Constant Field Values
Method Detail

brake

void brake()
Applies active braking if supported by the motor controller.

If active braking is not supported by the motor controller, this method will have the same effect as the stop method or setPower(0).

See the documentation for the supporting classes for your robotics controller or motor controller to determine if active braking is supported.


setPower

void setPower(int power)
Sets the motor's power.

Parameters:
power - The power level to set.
  • 16 = maximum forward power
  • 0 = no power, motor will coast and/or stop
  • -16 = maximum reverse power

stop

void stop()
Turns the motor power off, allowing the motor to coast or stop.

This method has the same effect as setPower(STOP) or setPower(0).


RoboJDETM v2.0

Copyright (c) 2003-2009 RidgeSoft, LLC. All rights reserved.
www.ridgesoft.com