Package lejos.hardware.device
Class LSC
- java.lang.Object
-
- lejos.hardware.Device
-
- lejos.hardware.sensor.BaseSensor
-
- lejos.hardware.sensor.I2CSensor
-
- lejos.hardware.device.LSC
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,SensorConstants,SensorMode,SensorModes,SampleProvider
public class LSC extends I2CSensor
This class has been defined to manage the device LSC, Lattebox Servo Controller which manage until 10 RC Servos / DC Motors- Author:
- Juan Antonio Brenha Moral
-
-
Field Summary
-
Fields inherited from class lejos.hardware.sensor.I2CSensor
address, DEFAULT_I2C_ADDRESS, port, REG_PRODUCT_ID, REG_VENDOR_ID, REG_VERSION, retryCount
-
Fields inherited from class lejos.hardware.sensor.BaseSensor
currentMode, modes
-
Fields inherited from interface lejos.hardware.sensor.SensorConstants
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDCMotor(int location, java.lang.String name)Method to add a DC MotorvoidaddDCMotor(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 MotorvoidaddServo(int location, java.lang.String name)Method to add a RC servo to current LSCvoidaddServo(int location, java.lang.String name, int min_angle, int max_angle)Method to add a RC servo to current LSCvoidcalibrate()This method check LSC connected with NXTe Currently I am debuggingLDCMotorgetDCMotor(int index)Method to get an LDC MotorLServogetServo(int index)Method to get an RC Servo in a LSCvoidloadAllServos()Load all servos connected this this LSCvoidunloadAllServos()Unload all servos connected in a LSC-
Methods inherited from class lejos.hardware.sensor.I2CSensor
fetchString, getAddress, getData, getData, getPort, getProductID, getRetryCount, getVendorID, getVersion, sendData, sendData, sendData, setAddress, setRetryCount
-
Methods inherited from class lejos.hardware.sensor.BaseSensor
fetchSample, getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, getName, sampleSize, setCurrentMode, setCurrentMode, setModes
-
Methods inherited from class lejos.hardware.Device
close, releaseOnClose
-
-
-
-
Method Detail
-
addServo
public void addServo(int location, java.lang.String name) throws java.lang.ArrayIndexOutOfBoundsExceptionMethod to add a RC servo to current LSC- Parameters:
location- the locationname- the name of the servo- Throws:
java.lang.ArrayIndexOutOfBoundsException
-
addServo
public void addServo(int location, java.lang.String name, int min_angle, int max_angle) throws java.lang.ArrayIndexOutOfBoundsExceptionMethod to add a RC servo to current LSC- Parameters:
location- the locationname- the name of the servo- Throws:
java.lang.ArrayIndexOutOfBoundsException
-
getServo
public LServo getServo(int index)
Method to get an RC Servo in a LSC- Parameters:
index- in the array- Returns:
- the LServo object
-
addDCMotor
public void addDCMotor(int location, java.lang.String name) throws java.lang.ArrayIndexOutOfBoundsExceptionMethod to add a DC Motor- Parameters:
location- the locationname- the name of the motor- Throws:
java.lang.ArrayIndexOutOfBoundsException
-
addDCMotor
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.ArrayIndexOutOfBoundsExceptionMethod to add a DC Motor- Parameters:
location-name-- Throws:
java.lang.ArrayIndexOutOfBoundsException
-
getDCMotor
public LDCMotor getDCMotor(int index)
Method to get an LDC Motor- Parameters:
index- the index in the array- Returns:
- the LDC Motor
-
calibrate
public void calibrate()
This method check LSC connected with NXTe Currently I am debugging
-
loadAllServos
public void loadAllServos()
Load all servos connected this this LSC
-
unloadAllServos
public void unloadAllServos()
Unload all servos connected in a LSC
-
-