public class LMotor extends I2CSensor
| Modifier and Type | Field and Description |
|---|---|
static int[] |
arrMotorLoad |
static int[] |
arrMotorUnload |
protected int |
LSC_position |
protected byte |
SPI_PORT |
address, DEFAULT_I2C_ADDRESS, port, REG_PRODUCT_ID, REG_VENDOR_ID, REG_VERSION, retryCountcurrentMode, modesBLACK, BLANK_INDEX, BLUE, BLUE_INDEX, BROWN, GREEN, GREEN_INDEX, MAX_TYPE, MIN_TYPE, MODE_RAW, NXT_ADC_RES, RED, RED_INDEX, TYPE_ANGLE, TYPE_COLORBLUE, TYPE_COLORFULL, TYPE_COLORGREEN, TYPE_COLORNONE, TYPE_COLORRED, TYPE_CUSTOM, TYPE_HIGHSPEED, TYPE_HIGHSPEED_9V, 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, WHITE, YELLOW| Constructor and Description |
|---|
LMotor(I2CPort port,
int location,
java.lang.String name,
byte SPI_PORT)
Constructor
|
LMotor(Port port,
int location,
java.lang.String name,
byte SPI_PORT)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getName()
Get name from a RC Servo or a DC Motor
|
protected int |
getPulse()
This method return current pulse over a RC Servo or a DC Motor.
|
boolean |
isMoving()
Method to know if Servo is moving to a determinated angle
|
void |
load()
Load Servo located in a position X
|
void |
setDelay(int delay)
Set a delay in a Motor
|
protected void |
setPulse(int pulse)
This class set the Pulse over a RC Servo or a DC Motor
|
void |
unload() |
fetchString, getAddress, getData, getData, getPort, getProductID, getRetryCount, getVendorID, getVersion, sendData, sendData, sendData, setAddress, setRetryCountfetchSample, getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, sampleSize, setCurrentMode, setCurrentMode, setModesclose, releaseOnCloseprotected int LSC_position
protected byte SPI_PORT
public static final int[] arrMotorUnload
public static final int[] arrMotorLoad
public LMotor(I2CPort port, int location, java.lang.String name, byte SPI_PORT)
port - the portlocation - the locationname - the name of the servoSPI_PORT - the SPI portpublic LMotor(Port port, int location, java.lang.String name, byte SPI_PORT)
port - the portlocation - the locationname - the name of the servoSPI_PORT - the SPI portpublic boolean isMoving()
public void setDelay(int delay)
delay - the delaypublic void unload()
public void load()
public java.lang.String getName()
getName in interface SensorModegetName in class BaseSensorprotected void setPulse(int pulse)
pulse - protected int getPulse()