daisy::RgbLed¶
Module: LIBDAISY / HUMAN_INTERFACE / FEEDBACK
#include <rgb_led.h>
Public Functions¶
Name | |
---|---|
RgbLed() | |
~RgbLed() | |
void | Init(dsy_gpio_pin red, dsy_gpio_pin green, dsy_gpio_pin blue, bool invert) |
void | Set(float r, float g, float b) |
void | SetRed(float val) |
void | SetGreen(float val) |
void | SetBlue(float val) |
void | SetColor(Color c) |
void | Update() |
Detailed Description¶
3x LEDs configured as an RGB for ease of use.
Public Functions Documentation¶
function RgbLed¶
function ~RgbLed¶
function Init¶
Parameters:
- red Red element
- green Green element
- blue Blue element
- invert Flips led polarity
Initializes 3x GPIO Pins as red, green, and blue elements of an RGB LED
function Set¶
Parameters:
- r Red element
- g Green element
- b Blue element
Sets each element of the LED with a floating point number 0-1
function SetRed¶
Parameters:
- val brightness of the red channel
Sets the red channel of the LED with a floating point number 0-1
function SetGreen¶
Parameters:
- val brightness of the green channel
Sets the green channel of the LED with a floating point number 0-1
function SetBlue¶
Parameters:
- val brightness of the blue channel
Sets the blue channel of the LED with a floating point number 0-1
function SetColor¶
Parameters:
- c Color object to set.
Sets the RGB using a Color object.
function Update¶
Updates the PWM of the LED based on the current values. Should be called at a regular interval. (i.e. 1kHz/1ms)
---¶
Updated on 2024-01-03 at 19:41:01 +0000