Class ServoUtil


  • public class ServoUtil
    extends Object
    • Constructor Detail

      • ServoUtil

        public ServoUtil()
    • Method Detail

      • calcPulseMsPerBit

        public static double calcPulseMsPerBit​(int pwmFrequency,
                                               int range)
      • calcServoPulseBits

        public static int calcServoPulseBits​(double pulseWidthMs,
                                             double pulseMsPerBit)
      • calcServoPulseBits

        public static int calcServoPulseBits​(double pulseWidthMs,
                                             int pwmFrequency,
                                             int range)
        Calculate the number of bits required for the specified pulse width (milliseconds)
        Parameters:
        pulseWidthMs - The required pulse width value
        pwmFrequency - The servo driver PWM Frequency
        range - The servo driver range, i.e. if 12 bit then this would be 4096
        Returns:
        Relative servo driver duty cycle value required to set the requested pulse width