Package lejos.hardware.device
Class PFMateMotor
- java.lang.Object
-
- lejos.hardware.device.PFMateMotor
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbackward()Runs the motor backwardvoidflt()Floats the motorvoidforward()Runs the motor forwardintgetPower()Returns the current motor power setting.intgetSpeed()returns the speedbooleanisBackward()Determines if motor is moving backwards this is based on what the receiver has in its registersbooleanisFlt()Determines if motor is floating this is based on what the receiver has in its registersbooleanisForward()Determines if motor is moving forward this is based on what the receiver has in its registersbooleanisMoving()Returntrueif the motor is moving.booleanisStop()Determines if motor is stopped this is based on what the receiver has in its registersvoidsetPower(int power)Set the power level 0%-100% to be applied to the motorvoidsetSpeed(int speed)Sets the motors speedvoidstop()Stops the Motor
-
-
-
Method Detail
-
backward
public void backward()
Runs the motor backward
-
setSpeed
public void setSpeed(int speed)
Sets the motors speed- Parameters:
speed- 1 = 7
-
getSpeed
public int getSpeed()
returns the speed- Returns:
- 1 - 7
-
isFlt
public boolean isFlt()
Determines if motor is floating this is based on what the receiver has in its registers- Returns:
- boolean
-
isForward
public boolean isForward()
Determines if motor is moving forward this is based on what the receiver has in its registers- Returns:
- boolean
-
isBackward
public boolean isBackward()
Determines if motor is moving backwards this is based on what the receiver has in its registers- Returns:
- boolean
-
isStop
public boolean isStop()
Determines if motor is stopped this is based on what the receiver has in its registers- Returns:
- boolean
-
isMoving
public boolean isMoving()
Description copied from interface:BaseMotorReturntrueif the motor is moving.
-
setPower
public void setPower(int power)
Description copied from interface:DCMotorSet the power level 0%-100% to be applied to the motor
-
-