Class LServo

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, SensorConstants, SensorMode, SensorModes, SampleProvider

    public class LServo
    extends LMotor
    LServo, Lattebox Servo, is a abstraction to model any RC Servo (continous and non continous) plugged to LSC, Lattebox Servo Controller.
    Author:
    Juan Antonio Brenha Moral
    • Constructor Detail

      • LServo

        public LServo​(I2CPort port,
                      int location,
                      java.lang.String servoName,
                      byte SPI_PORT)
        Constructor
        Parameters:
        port -
        location -
        servoName -
        SPI_PORT -
      • LServo

        public 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
        Parameters:
        port -
        location -
        servoName -
        SPI_PORT -
        min_angle -
        max_angle -
      • LServo

        public 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
        Parameters:
        port -
        location -
        servoName -
        SPI_PORT -
        min_angle -
        max_angle -
        init_angle -
    • Method Detail

      • setAngle

        public void setAngle​(int angle)
        Method to set an Angle in a RC Servo.
        Parameters:
        angle -
      • getAngle

        public int getAngle()
        Method to know the angle
        Returns:
        the angle
      • setMinAngle

        public void setMinAngle​(int minAngle)
        Set Minimal angle. Useful method to calibrate a Servo
        Parameters:
        minAngle - the minimum angle
      • setMaxAngle

        public void setMaxAngle​(int maxAngle)
        Set Maximum angle. Useful method to calibrate a Servo
        Parameters:
        maxAngle -
      • goToMinAngle

        public void goToMinAngle()
        Method to set minimal angle
      • goToMaxAngle

        public void goToMaxAngle()
        Method to set maximum angle
      • goToMiddleAngle

        public void goToMiddleAngle()
        Method to set medium angle
      • goToInitAngle

        public void goToInitAngle()
        Method to set medium angle
      • forward

        public void forward()
        Classic forward method for continous RC Servos
      • backward

        public void backward()
        Classic backward method for continous RC Servos