public class LSC extends I2CSensor
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 |
---|
LSC(I2CPort port,
byte SPI_PORT)
Constructor
|
LSC(Port port,
byte SPI_PORT)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addDCMotor(int location,
java.lang.String name)
Method to add a DC Motor
|
void |
addDCMotor(int location,
java.lang.String name,
int forward_min_speed,
int forward_max_speed,
int backward_min_speed,
int backward_max_speed)
Method to add a DC Motor
|
void |
addServo(int location,
java.lang.String name)
Method to add a RC servo to current LSC
|
void |
addServo(int location,
java.lang.String name,
int min_angle,
int max_angle)
Method to add a RC servo to current LSC
|
void |
calibrate()
This method check LSC connected with NXTe
Currently I am debugging
|
LDCMotor |
getDCMotor(int index)
Method to get an LDC Motor
|
LServo |
getServo(int index)
Method to get an RC Servo in a LSC
|
void |
loadAllServos()
Load all servos connected this this LSC
|
void |
unloadAllServos()
Unload all servos connected in a LSC
|
fetchString, getAddress, getData, getData, getPort, getProductID, getRetryCount, getVendorID, getVersion, sendData, sendData, sendData, setAddress, setRetryCount
fetchSample, getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, getName, sampleSize, setCurrentMode, setCurrentMode, setModes
close, releaseOnClose
public LSC(I2CPort port, byte SPI_PORT)
port
- SPI_PORT
- public LSC(Port port, byte SPI_PORT)
port
- SPI_PORT
- public void addServo(int location, java.lang.String name) throws java.lang.ArrayIndexOutOfBoundsException
location
- the locationname
- the name of the servojava.lang.ArrayIndexOutOfBoundsException
public void addServo(int location, java.lang.String name, int min_angle, int max_angle) throws java.lang.ArrayIndexOutOfBoundsException
location
- the locationname
- the name of the servojava.lang.ArrayIndexOutOfBoundsException
public LServo getServo(int index)
index
- in the arraypublic void addDCMotor(int location, java.lang.String name) throws java.lang.ArrayIndexOutOfBoundsException
location
- the locationname
- the name of the motorjava.lang.ArrayIndexOutOfBoundsException
public void addDCMotor(int location, java.lang.String name, int forward_min_speed, int forward_max_speed, int backward_min_speed, int backward_max_speed) throws java.lang.ArrayIndexOutOfBoundsException
location
- name
- java.lang.ArrayIndexOutOfBoundsException
public LDCMotor getDCMotor(int index)
index
- the index in the arraypublic void calibrate()
public void loadAllServos()
public void unloadAllServos()