Package lejos.robotics
Interface RegulatedMotorListener
-
- All Known Implementing Classes:
MirrorMotor,OmniPilot,SteeringPilot
public interface RegulatedMotorListenerThis interface defines a listener that is notified of the tachometer when the motor starts and stops rotating. It doesn't matter if start/stop rotation is caused by Motor.forward() or Motor.rotateTo(), or if the rotation is terminated by rotationTo() finishing naturally or by stop(). If the motor state changes directly from forward() to backward(), then a stop() is called in between which results in a new rotationEnded() and rotationStarted() notification.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidrotationStarted(RegulatedMotor motor, int tachoCount, boolean stalled, long timeStamp)Called when the motor starts rotating.voidrotationStopped(RegulatedMotor motor, int tachoCount, boolean stalled, long timeStamp)Called when the motor stops rotating.
-
-
-
Method Detail
-
rotationStarted
void rotationStarted(RegulatedMotor motor, int tachoCount, boolean stalled, long timeStamp)
Called when the motor starts rotating.
-
rotationStopped
void rotationStopped(RegulatedMotor motor, int tachoCount, boolean stalled, long timeStamp)
Called when the motor stops rotating. This includes both Motor.stop() which locks the shaft, and Motor.flt() in which the shaft floats freely after power is cut to the motor. Beware: In the second case, it's possible the tachomoter reading will continue changing after notification.
-
-