sample-simplepio icon indicating copy to clipboard operation
sample-simplepio copied to clipboard

how to control more than 2 servos?

Open Mao-x-w opened this issue 7 years ago • 3 comments

how to control more than 2 servos?because there were only two pwm(pwm0 and pwm1)

Mao-x-w avatar Jun 15 '18 03:06 Mao-x-w

If you require additional peripherals, you can find a peripheral to expand the number of available PWM outputs. Additionally, you could interface with a motor driver, which specifically is meant to drive a set of motors.

Fleker avatar Jun 17 '18 16:06 Fleker

Can we use the GPIO port to simulate PWM output in Android Things.Like this:

void servo_pulse(int myangle) { int PulseWidth; PulseWidth = (myangle * 11) + 500; digitalWrite(ServoPin, HIGH); delayMicroseconds(PulseWidth); digitalWrite(ServoPin, LOW); delay(20 - PulseWidth / 1000); return; } I can't make the thread to sleep 0.5ms in Android Things.

Mao-x-w avatar Jun 19 '18 03:06 Mao-x-w

The GPIO control in Android Things doesn't have the level of precision that you may want for high frequency PWM.

Fleker avatar Jun 19 '18 17:06 Fleker