6

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.

Darth Vader
  • 4,218
  • 24
  • 47
  • 70
artus9033
  • 175
  • 2
  • 9

4 Answers4

4

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.

Milliways
  • 62,573
  • 32
  • 113
  • 225
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.

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.

arturofa95
  • 23
  • 10
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.

artus9033
  • 175
  • 2
  • 9