Shift Register + Potentiometer

For the discussion of Arduino related topics.

Moderator: phalanx

Post Reply
mda_dave
Posts: 1
Joined: Fri Nov 23, 2018 2:37 am

Shift Register + Potentiometer

Post by mda_dave » Fri Nov 23, 2018 2:44 am

I am using Arduino UNO as my microcontroller and my goal is simply to control 7 individual LEDs and their brightness altogether. I intend to keep using Arduino UNO and not upgrade to Arduino MEGA or something. Arduino UNO only has 6 PWM pins, so I am short one PWM pin, that is why I am trying to use the shift register.
It seems to me that it can help me to control the LEDs, but I do not see how I can control the brightness combined with the shift register.

Is it just not possible? or
Any suggestions for other methods or components to try?

Thank you.

darrellg
Posts: 345
Joined: Fri Oct 17, 2014 10:02 am
Location: Southern California

Re: Shift Register + Potentiometer

Post by darrellg » Fri Nov 23, 2018 11:31 am

The shift register is probably not going to work the way you want it to. You could use something like https://www.sparkfun.com/products/10615.

n1ist
Support Volunteer
Posts: 1038
Joined: Wed Mar 22, 2006 11:02 am

Re: Shift Register + Potentiometer

Post by n1ist » Sat Nov 24, 2018 1:13 pm

To do it in hardware, I would follow darrellg's advice.

If the Arduino isn't busy doing too many other things, I would do the PWM in software; have the timer generate an interrupt that bumps a counter; at each tick, have it check the 7 PWM values and set the output pin corresponding to each one based on whether the counter is below or above that channel's PWM value. You may have to use register access rather than digital.write to get the speed you want.
/mike

Post Reply