Class 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
    • Constructor Detail

      • LSC

        public LSC​(I2CPort port,
                   byte SPI_PORT)
        Constructor
        Parameters:
        port -
        SPI_PORT -
      • LSC

        public LSC​(Port port,
                   byte SPI_PORT)
        Constructor
        Parameters:
        port -
        SPI_PORT -
    • Method Detail

      • addServo

        public void addServo​(int location,
                             java.lang.String name)
                      throws java.lang.ArrayIndexOutOfBoundsException
        Method to add a RC servo to current LSC
        Parameters:
        location - the location
        name - 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.ArrayIndexOutOfBoundsException
        Method to add a RC servo to current LSC
        Parameters:
        location - the location
        name - 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.ArrayIndexOutOfBoundsException
        Method to add a DC Motor
        Parameters:
        location - the location
        name - 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.ArrayIndexOutOfBoundsException
        Method 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