lejos.nxt.addon
Class LDCMotor
java.lang.Object
lejos.nxt.I2CSensor
lejos.nxt.addon.LMotor
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
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)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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)
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)