Relative Content

Tag Archive for arduinoembeddedarduino-uno

Trying to do a brightness control pattern using PWM

Hi I’ve been trying to control my LEDs brightness using PWM but not all my LEDs are connected to a PWM port. How do I do it? I’m using an arduino uno, and I have a button on PD3. I’m quite new to this so there might be some errors in my code below. (Edit: I can’t use normal arduino IOs such as digitalWrite, analogWrite and etc). I can’t use my potentiometer to control the brightness as well because it is being used in a function. I could use an LDR to do the brightness control, but how would I do it as well?