2

I've read there https://www.raspberrypi.org/documentation/usage/gpio/ that we have 4 pins which can be used as analog, but other people say that we use only 2, so what's the correct answer?

fedos 3d
  • 31
  • 3

1 Answers1

7

The Raspberry Pi has NO analogue GPIO. All the GPIO are digital only.

Perhaps you are being confused by some Arduino terminology. If a digital GPIO is used to generate PWM they often incorrectly refer to that GPIO as an analogue output.

If that's the case you are probably referring to the Pi's hardware PWM (output) capability. The Pi's with the 40 pin header (and the compute modules) can provide hardware PWM on GPIO 12, 13, 18, 19. However there are only two PWM channels so GPIO 12/18 will have identical outputs as will GPIO 13/19.

joan
  • 71,014
  • 5
  • 73
  • 106
  • 1
    Note that PWM output is strictly speaking not an analog output, it's just a quickly switching digital output that may for some applications look like an analog output (i.e. when controlling the brightness of an LED). – PMF Nov 23 '19 at 13:37