lejos.nxt.addon
Class LDCMotor

java.lang.Object
  extended by lejos.nxt.I2CSensor
      extended by lejos.nxt.addon.LMotor
          extended by lejos.nxt.addon.LDCMotor
All Implemented Interfaces:
SensorConstants

public class LDCMotor
extends LMotor

LDCMotor, Lattebox DC Motor, is a abstraction to model any DCMotor connected to LSC, Lattebox Servo Controller.

Author:
Juan Antonio Brenha Moral

Field Summary
 
Fields inherited from class lejos.nxt.addon.LMotor
arrMotorLoad, arrMotorUnload, LSC_position, SPI_PORT
 
Fields inherited from class lejos.nxt.I2CSensor
PRODUCT_ID, SENSOR_TYPE, VERSION
 
Fields inherited from interface lejos.nxt.SensorConstants
MODE_ANGLESTEP, MODE_BOOLEAN, MODE_CELSIUS, MODE_FARENHEIT, MODE_PCTFULLSCALE, MODE_PERIODCOUNTER, MODE_RAW, MODE_TRANSITIONCNT, TYPE_ANGLE, TYPE_COLORBLUE, TYPE_COLORFULL, TYPE_COLORGREEN, TYPE_COLORNONE, TYPE_COLORRED, TYPE_CUSTOM, TYPE_HISPEED, TYPE_LIGHT_ACTIVE, TYPE_LIGHT_INACTIVE, TYPE_LOWSPEED, TYPE_LOWSPEED_9V, TYPE_NO_SENSOR, TYPE_REFLECTION, TYPE_SOUND_DB, TYPE_SOUND_DBA, TYPE_SWITCH, TYPE_TEMPERATURE
 
Constructor Summary
LDCMotor(SensorPort port, int location, String DCMotorName, byte SPI_PORT)
          Constructor
LDCMotor(SensorPort port, int location, String DCMotorName, byte SPI_PORT, int forwardMinSpeed, int forwardMaxSpeed, int backwardMinSpeed, int backwardMaxSpeed)
           
 
Method Summary
 int getSpeed()
          Method to get speed from the DC Motor
 void setBackwardMaxSpeed(int max_speed)
           
 void setBackwardMinSpeed(int min_speed)
           
 void setForwardMaxSpeed(int max_speed)
           
 void setForwardMinSpeed(int min_speed)
           
 void setSpeed(int speed)
          Method to set the speed in a DC Motor
 
Methods inherited from class lejos.nxt.addon.LMotor
getName, getPulse, isMoving, load, setDelay, setPulse, unload
 
Methods inherited from class lejos.nxt.I2CSensor
fetchString, getData, getPort, getProductID, getSensorType, getVersion, sendData, sendData, setAddress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LDCMotor

public LDCMotor(SensorPort port,
                int location,
                String DCMotorName,
                byte SPI_PORT)
Constructor

Parameters:
port -
location -
DCMotorName -
SPI_PORT -

LDCMotor

public LDCMotor(SensorPort port,
                int location,
                String DCMotorName,
                byte SPI_PORT,
                int forwardMinSpeed,
                int forwardMaxSpeed,
                int backwardMinSpeed,
                int backwardMaxSpeed)
Method Detail

setSpeed

public void setSpeed(int speed)
Method to set the speed in a DC Motor

Parameters:
speed - the speed

getSpeed

public int getSpeed()
Method to get speed from the DC Motor

Returns:
the speed

setForwardMinSpeed

public void setForwardMinSpeed(int min_speed)

setForwardMaxSpeed

public void setForwardMaxSpeed(int max_speed)

setBackwardMinSpeed

public void setBackwardMinSpeed(int min_speed)

setBackwardMaxSpeed

public void setBackwardMaxSpeed(int max_speed)