4

I'm interested in using the Android Things on the Pi 3 Model B, but I need to access a minimum of 4 pins and use them for PWM control.

On the pin-out diagram on Google's Android Things site, there are only two pins labeled PWM 0 (BCM 18) and PWM 1 (BCM 13). Does this mean the other ports aren't PWM-capable? Or is there any library for software PWM for Android Things? And another interesting thing: are pins #27 and #28 inaccessible for the platform? On the pin-out they're just white and have no description.

3

I suggest you put a hat on top of your raspberry pi. They communicate via I2C and multiply your PWM pins and you can stack them, there are already Java libraries popping out.

Yesterday, I successfully connected the Adafruit DC & Stepper Motor HAT for Raspberry Pi to my Pi3 model B and got to independently control each one of the Rover 5 platform's motors using one of the hardware libraries from http://www.androidrobocar.com.

Today I'll be stacking another hat on top of that Motor HAT to control more servos and leds.

3

All Pi models have identical GPIO, even though the pinout varies between models. PWM can be assigned to different pins, but there are still only 2 channels. See http://www.panu.it/raspberry/ for pinout.

There are libraries e.g. pigpio which enable software PWM on more.

  • I know that, but I need a library for Android Things. Is there any? – Artus 90 Jun 7 '17 at 13:33
0

As far as I know there are 2 PWM pins in the Pi3 Model B. However, if you are willing to spend 15$, you could try something like this using I2C.

0

To conclude, there's no way to get more pwm channels on a rpi running Android Things. I finally decided to stick to pigpio on raspbian.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.