Class daisy::Led¶
LED Class providing simple Software PWM ability, etc Eventually this will work with hardware PWM, and external LED Driver devices as well.More...
#include <led.h>
Public Functions¶
Type | Name |
---|---|
void | Init (Pin pin, bool invert, float samplerate=1000.0f) |
Led () |
|
void | Set (float val) |
void | SetSampleRate (float sample_rate) |
void | Update () |
~Led () |
Detailed Description¶
Author:
shensley
Date:
March 2020
Public Functions Documentation¶
function Init¶
Initializes an LED using the specified hardware pin.
Parameters:
pin
chooses LED pininvert
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)
function Led¶
function 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.
function SetSampleRate¶
Set the rate at which you'll update the leds without reiniting the led
Parameters:
sample_rate
New update rate in hz.
function Update¶
This processes the pwm of the LED sets the hardware accordingly.
function ~Led¶
The documentation for this class was generated from the following file external-docs/libDaisy/src/hid/led.h