lejos.nxt.addon
Class PFMateMotor

java.lang.Object
  extended by lejos.nxt.addon.PFMateMotor
All Implemented Interfaces:
BaseMotor, DCMotor

public class PFMateMotor
extends java.lang.Object
implements DCMotor

Motor class for PFMate class

Author:
Michael Smith

Method Summary
 void backward()
          Runs the motor backward
 void flt()
          Floats the motor
 void forward()
          Runs the motor forward
 int getPower()
          Returns the current motor power setting.
 int getSpeed()
          returns the speed
 boolean isBackward()
          Determines if motor is moving backwards this is based on what the receiver has in its registers
 boolean isFlt()
          Determines if motor is floating this is based on what the receiver has in its registers
 boolean isForward()
          Determines if motor is moving forward this is based on what the receiver has in its registers
 boolean isMoving()
          Return true if the motor is moving.
 boolean isStop()
          Determines if motor is stopped this is based on what the receiver has in its registers
 void setPower(int power)
          Set the power level 0%-100% to be applied to the motor
 void setSpeed(int speed)
          Sets the motors speed
 void stop()
          Stops the Motor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

flt

public void flt()
Floats the motor

Specified by:
flt in interface BaseMotor

forward

public void forward()
Runs the motor forward

Specified by:
forward in interface BaseMotor

backward

public void backward()
Runs the motor backward

Specified by:
backward in interface BaseMotor

stop

public void stop()
Stops the Motor

Specified by:
stop in interface BaseMotor

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: BaseMotor
Return true if the motor is moving.

Specified by:
isMoving in interface BaseMotor
Returns:
true if the motor is currently in motion, false if stopped.

setPower

public void setPower(int power)
Description copied from interface: DCMotor
Set the power level 0%-100% to be applied to the motor

Specified by:
setPower in interface DCMotor
Parameters:
power - new motor power 0-100

getPower

public int getPower()
Description copied from interface: DCMotor
Returns the current motor power setting.

Specified by:
getPower in interface DCMotor
Returns:
current power 0-100