Class daisy::RgbLed¶
#include <rgb_led.h>
Public Functions¶
| Type | Name |
|---|---|
| void | Init (Pin red, Pin green, Pin blue, bool invert) |
| RgbLed () |
|
| void | Set (float r, float g, float b) |
| void | SetBlue (float val) |
| void | SetColor (Color c) |
| void | SetGreen (float val) |
| void | SetRed (float val) |
| void | Update () |
| ~RgbLed () |
Detailed Description¶
3x LEDs configured as an RGB for ease of use.
Public Functions Documentation¶
function Init¶
Initializes 3x GPIO Pins as red, green, and blue elements of an RGB LED
Parameters:
redRed elementgreenGreen elementblueBlue elementinvertFlips led polarity
function RgbLed¶
function Set¶
Sets each element of the LED with a floating point number 0-1
Parameters:
rRed elementgGreen elementbBlue element
function SetBlue¶
Sets the blue channel of the LED with a floating point number 0-1
Parameters:
valbrightness of the blue channel
function SetColor¶
Sets the RGB using a Color object.
Parameters:
cColor object to set.
function SetGreen¶
Sets the green channel of the LED with a floating point number 0-1
Parameters:
valbrightness of the green channel
function SetRed¶
Sets the red channel of the LED with a floating point number 0-1
Parameters:
valbrightness of the red channel
function Update¶
Updates the PWM of the LED based on the current values. Should be called at a regular interval. (i.e. 1kHz/1ms)
function ~RgbLed¶
The documentation for this class was generated from the following file external-docs/libDaisy/src/hid/rgb_led.h