3

I'm using this circuit for my project, which I referred from https://www.sparkfun.com/news/1396.

enter image description here

enter image description here

I don't really understand how current works in GPIO pins, so the question is: instead of connecting them to pin 4, 6, 7, can I connect them to pin 4, 6, 12? as I need control over the brightness of LED and it seems I can only do that through the PCM_CLK pin.

Thanks!

0

Yes you probably could. I've not heard of anyone controlling the brightness of infra red IRs before, but that might just be my ignorance.

However PWM signals can be generated on all the GPIO. The only advantage of using GPIO 18 (pin 12) is that like GPIOs 12, 13, and 19 it can be connected to the Pi's hardware PWM peripheral.

See https://pinout.xyz/ for a diagram showing the mapping of GPIO to pins on the extension header.

As I say PWM can be generated on all GPIO.

My pigpio library has this feature. To generate PWM on GPIO 4 (pin 7) do

sudo pigpiod

pigs p 4 64 # 1/4 dutycycle
pigs p 4 128 # 1/2 dutycycle
pigs p 4 192 # 3/4 dutycycle
pigs p 4 255 # full on

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.