lejos.nxt.addon
Class LSC

java.lang.Object
  extended by lejos.nxt.I2CSensor
      extended by lejos.nxt.addon.LSC
All Implemented Interfaces:
SensorConstants

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.nxt.I2CSensor
PRODUCT_ID, SENSOR_TYPE, VERSION
 
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
LSC(SensorPort port, byte SPI_PORT)
          Constructor
 
Method Summary
 void addDCMotor(int location, String name)
          Method to add a DC Motor
 void addDCMotor(int location, 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, String name)
          Method to add a RC servo to current LSC
 void addServo(int location, 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
 
Methods inherited from class lejos.nxt.I2CSensor
fetchString, getData, getPort, getProductID, getSensorType, getVersion, sendData, sendData, setAddress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LSC

public LSC(SensorPort port,
           byte SPI_PORT)
Constructor

Parameters:
port -
SPI_PORT -
Method Detail

addServo

public void addServo(int location,
                     String name)
              throws ArrayIndexOutOfBoundsException
Method to add a RC servo to current LSC

Parameters:
location - the location
name - the name of the servo
Throws:
ArrayIndexOutOfBoundsException

addServo

public void addServo(int location,
                     String name,
                     int min_angle,
                     int max_angle)
              throws ArrayIndexOutOfBoundsException
Method to add a RC servo to current LSC

Parameters:
location - the location
name - the name of the servo
Throws:
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,
                       String name)
                throws ArrayIndexOutOfBoundsException
Method to add a DC Motor

Parameters:
location - the location
name - the name of the motor
Throws:
ArrayIndexOutOfBoundsException

addDCMotor

public void addDCMotor(int location,
                       String name,
                       int forward_min_speed,
                       int forward_max_speed,
                       int backward_min_speed,
                       int backward_max_speed)
                throws ArrayIndexOutOfBoundsException
Method to add a DC Motor

Parameters:
location -
name -
Throws:
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