public class LServo extends LMotor
arrMotorLoad, arrMotorUnload, LSC_position, SPI_PORT
address, DEFAULT_I2C_ADDRESS, port, REG_PRODUCT_ID, REG_VENDOR_ID, REG_VERSION, retryCount
currentMode, modes
BLACK, 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 |
---|
LServo(I2CPort port,
int location,
java.lang.String servoName,
byte SPI_PORT)
Constructor
|
LServo(I2CPort port,
int location,
java.lang.String servoName,
byte SPI_PORT,
int min_angle,
int max_angle)
Constructor with the feature to set min and max angle
|
LServo(I2CPort port,
int location,
java.lang.String servoName,
byte SPI_PORT,
int min_angle,
int max_angle,
int init_angle)
Constructor with the feature to set min, max and init angle
|
Modifier and Type | Method and Description |
---|---|
void |
backward()
Classic backward method for continous RC Servos
|
void |
forward()
Classic forward method for continous RC Servos
|
int |
getAngle()
Method to know the angle
|
void |
goToInitAngle()
Method to set medium angle
|
void |
goToMaxAngle()
Method to set maximum angle
|
void |
goToMiddleAngle()
Method to set medium angle
|
void |
goToMinAngle()
Method to set minimal angle
|
void |
setAngle(int angle)
Method to set an Angle in a RC Servo.
|
void |
setMaxAngle(int maxAngle)
Set Maximum angle.
|
void |
setMinAngle(int minAngle)
Set Minimal angle.
|
getName, getPulse, isMoving, load, setDelay, setPulse, unload
fetchString, getAddress, getData, getData, getPort, getProductID, getRetryCount, getVendorID, getVersion, sendData, sendData, sendData, setAddress, setRetryCount
fetchSample, getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, sampleSize, setCurrentMode, setCurrentMode, setModes
close, releaseOnClose
public LServo(I2CPort port, int location, java.lang.String servoName, byte SPI_PORT)
port
- location
- servoName
- SPI_PORT
- public LServo(I2CPort port, int location, java.lang.String servoName, byte SPI_PORT, int min_angle, int max_angle)
port
- location
- servoName
- SPI_PORT
- min_angle
- max_angle
- public LServo(I2CPort port, int location, java.lang.String servoName, byte SPI_PORT, int min_angle, int max_angle, int init_angle)
port
- location
- servoName
- SPI_PORT
- min_angle
- max_angle
- init_angle
- public void setAngle(int angle)
angle
- public int getAngle()
public void setMinAngle(int minAngle)
minAngle
- the minimum anglepublic void setMaxAngle(int maxAngle)
maxAngle
- public void goToMinAngle()
public void goToMaxAngle()
public void goToMiddleAngle()
public void goToInitAngle()
public void forward()
public void backward()