public class ServoUtil extends Object
Constructor and Description |
---|
ServoUtil() |
Modifier and Type | Method and Description |
---|---|
static double |
calcPulseMsPerBit(int pwmFrequency,
int range) |
static int |
calcServoPulseBits(double pulseWidthMs,
double pulseMsPerBit) |
static int |
calcServoPulseBits(double pulseWidthMs,
int pwmFrequency,
int range)
Calculate the number of bits required for the specified pulse width (milliseconds)
|
public static double calcPulseMsPerBit(int pwmFrequency, int range)
public static int calcServoPulseBits(double pulseWidthMs, double pulseMsPerBit)
public static int calcServoPulseBits(double pulseWidthMs, int pwmFrequency, int range)
pulseWidthMs
- The required pulse width valuepwmFrequency
- The servo driver PWM Frequencyrange
- The servo driver range, i.e. if 12 bit then this would be 4096Copyright © 2016–2017 mattjlewis. All rights reserved.