LED Class providing simple Software PWM ability, etc
Eventually this will work with hardware PWM, and external LED Driver devices as well.
More...
LED Class providing simple Software PWM ability, etc
Eventually this will work with hardware PWM, and external LED Driver devices as well.
- Author
- shensley
- Date
- March 2020
#include <led.h>
◆ Led()
◆ ~Led()
◆ Init()
Initializes an LED using the specified hardware pin.
- Parameters
-
pin | chooses LED pin |
invert | will set whether to internally invert the brightness due to hardware config. |
samplerate | sets the rate at which 'Update()' will be called (used for software PWM) |
◆ Set()
Sets the brightness of the Led.
- Parameters
-
val | will be cubed for gamma correction, and then quantized to 8-bit values for Software PWM 8-bit is for more flexible update rate options, as 12-bit or more would require faster update rates. |
◆ SetSampleRate()
void daisy::Led::SetSampleRate |
( |
float |
sample_rate | ) |
|
|
inline |
Set the rate at which you'll update the leds without reiniting the led
- Parameters
-
sample_rate | New update rate in hz. |
◆ Update()
void daisy::Led::Update |
( |
| ) |
|
This processes the pwm of the LED sets the hardware accordingly.
The documentation for this class was generated from the following file: