Class ServoTrim


  • public class ServoTrim
    extends Object
    Arduino defaults to a range of 544 to 2400. 1 to 2 ms is the minimum pulse range used in the R/C radio control industry. The maximum pulse range is a servo specific value that you must determine by either manufacture's datasheet information or by testing of the specific servo you are using.
    • Field Detail

      • DEFAULT

        public static final ServoTrim DEFAULT
        Default to 180 degree range, from 0.6ms to 2.4ms with 1.5ms centre
      • TOWERPRO_SG90

        public static final ServoTrim TOWERPRO_SG90
      • TOWERPRO_SG5010

        public static final ServoTrim TOWERPRO_SG5010
      • MG996R

        public static final ServoTrim MG996R
    • Constructor Detail

      • ServoTrim

        public ServoTrim​(int midPulseWidthUs,
                         int ninetyDegPulseWidthUs)
        Assumes 180 degree range of movement
        Parameters:
        midPulseWidthUs - Pulse width in microseconds corresponding to the centre position (90 degrees)
        ninetyDegPulseWidthUs - Pulse width in microseconds corresponding to a 90 degree movement in either direction
      • ServoTrim

        public ServoTrim​(int midPulseWidthUs,
                         int ninetyDegPulseWidthUs,
                         int rangePulseWidthUs)
      • ServoTrim

        public ServoTrim​(int midPulseWidthUs,
                         int ninetyDegPulseWidthUs,
                         int minPulseWidthUs,
                         int maxPulseWidthUs)
    • Method Detail

      • getMidPulseWidthUs

        public int getMidPulseWidthUs()
      • getMidPulseWidthMs

        public float getMidPulseWidthMs()
      • getNinetyDegPulseWidthUs

        public int getNinetyDegPulseWidthUs()
      • getNinetyDegPulseWidthMs

        public float getNinetyDegPulseWidthMs()
      • getMinPulseWidthUs

        public int getMinPulseWidthUs()
      • getMinPulseWidthMs

        public float getMinPulseWidthMs()
      • getMaxPulseWidthUs

        public int getMaxPulseWidthUs()
      • getMaxPulseWidthMs

        public float getMaxPulseWidthMs()
      • getMinAngle

        public int getMinAngle()
      • getMaxAngle

        public int getMaxAngle()
      • getMidAngle

        public int getMidAngle()
      • convertPulseWidthUsToAngle

        public int convertPulseWidthUsToAngle​(int pulseWidthUs)
      • convertAngleToPulseWidthUs

        public int convertAngleToPulseWidthUs​(int angle)
      • convertPulseWidthMsToAngle

        public int convertPulseWidthMsToAngle​(float pulseWidthMs)
      • convertAngleToPulseWidthMs

        public float convertAngleToPulseWidthMs​(int angle)