-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Open
Description
The SDK doesn't seem to provide an api, say PwmControl.setPwm(), to be able to specify an exact pwm pusle width.
The following technique seems to work though:
boolean setPwm(Servo servo, double usPwm)
{
if (usPwm >= 500.0 && usPwm <= 2500.00) {
if (PwmControl.class.isInstance(servo)) {
PwmControl pwm = (PwmControl) servo;
PwmControl.PwmRange range = pwm.getPwmRange();
pwm.setPwmRange(new PwmControl.PwmRange(usPwm, usPwm, range.usFrame));
servo.setPosition(1.0);
return true;
}
}
return false;
}Would this technique be reliable?
Metadata
Metadata
Assignees
Labels
No labels