Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to control more than 2 servos? #9

Open
Mao-x-w opened this issue Jun 15, 2018 · 3 comments
Open

how to control more than 2 servos? #9

Mao-x-w opened this issue Jun 15, 2018 · 3 comments

Comments

@Mao-x-w
Copy link

Mao-x-w commented Jun 15, 2018

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

@Fleker
Copy link
Contributor

Fleker commented Jun 17, 2018

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.

@Mao-x-w
Copy link
Author

Mao-x-w commented Jun 19, 2018

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.

@Fleker
Copy link
Contributor

Fleker commented Jun 19, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants