3 ms·
As I remember PWM is to control the brightness of the LED. LEDs can only shine at one brightness, they're either on or off, so to dim them to half-brightness yo
by johnaspden 4y ago
As I remember PWM is to control the brightness of the LED. LEDs can only shine at one brightness, they're either on or off, so to dim them to half-brightness you need to have them on half the time, off half the time. That's how you get all the different colours from three LEDs.
But they can switch on and off very fast, so if 50Hz is flickery, you can use 500Hz, or 5000Hz. Most microcontrollers have circuitry for this built in, so you just literally write a different constant into the controller.
I once made an LED dashboard for use in police cars. After it was rolled out, it was discovered that the flicker frequency was interfering with the radio (the only bug ever found in my code!)
My client called me back in to fix it, so I added a zero in the relevant place, and recompiled the code.
£400 for about twenty minutes work.
- klodolph 4y ago> LEDs can only shine at one brightness, they're either on or off, This is factually incorrect. LEDs shine at a range of brightnesses. The amount of light emitted is related to the amount of current flowing through the LED, which you are free to control however you want. The cheapest way to do this is to use something like PWM and monitor the average current flowing through the LEDs. However, you can also just use a constant current source, and adjust it to provide the amount of current that you want. I don't know where the idea comes from that LEDs are only on or off. There's no basis in fact here, as far as I can tell.