4 ms·
PWM resources can be quite scarce or overkill for a constant brightness level, just pick the right current limiting resistor, it's embedded design 101. Heck, it
by arcticbull 8y ago
PWM resources can be quite scarce or overkill for a constant brightness level, just pick the right current limiting resistor, it's embedded design 101. Heck, it's your first-year electrical engineering class.
- monocasa 8y agoIt's not hard to PWM by hand; it takes next to no resources. Current limiting resistors don't really do great at lower strength; LEDs have far from linear responses and it's very constrained at the lower end that you want. Source: wrote embedded firmware for close to a decade.
- arcticbull 8y agoThanks for that! I'll keep that in mind. I'm largely self-taught in embedded. Curious what you mean by PWM by hand.
- monocasa 8y ago> Curious what you mean by PWM by hand. Have a timer that is some function of your PWM frequency, and manually toggle the GPIO line in the timer interrupt. You can do it in a super loop too if you don't care about power consumption.
- smolder 8y agoYou don't need a whole pwm for a constant brightness reduction. The pulse width never has to change, which is the main feature of pwms.