lejos.nxt
Class NXTMotor
java.lang.Object
lejos.nxt.BasicMotor
lejos.nxt.NXTMotor
- All Implemented Interfaces:
- BaseMotor, DCMotor, Encoder, EncoderMotor
- Direct Known Subclasses:
- DSwitch
public class NXTMotor
- extends BasicMotor
- implements EncoderMotor
Abstraction for an NXT motor with no speed regulation.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
encoderPort
protected Encoder encoderPort
NXTMotor
public NXTMotor(TachoMotorPort port,
int PWMMode)
- Create an instance of a NXTMotor using the specified motor port and
PWM operating mode.
- Parameters:
port
- The motor port that the motor will be attached to.PWMMode
- see BasicMotorPort.PWM_FLOAT
and see BasicMotorPort.PWM_BRAKE
NXTMotor
public NXTMotor(TachoMotorPort port)
- Create an instance of a NXTMotor using the specified motor port the
PWM operating mode will be PWM_BREAK
BasicMotorPort.PWM_BRAKE
- Parameters:
port
- The motor port that the motor will be attached to.
getTachoCount
public int getTachoCount()
- Description copied from interface:
Encoder
- Returns the tachometer count.
- Specified by:
getTachoCount
in interface Encoder
- Returns:
- tachometer count in degrees
resetTachoCount
public void resetTachoCount()
- Description copied from interface:
Encoder
- Reset the tachometer count.
- Specified by:
resetTachoCount
in interface Encoder