A class to control a RGB LED. More...
#include <RGBLed.h>
Public Member Functions | |
| void | begin () |
| Initialize the RGB LED. | |
| RGBLed (uint8_t pinR, uint8_t pinG, uint8_t pinB) | |
| Construct a new RGBLed object. | |
| void | stop () |
| Stop the RGB LED. | |
| void | write (uint8_t r, uint8_t g, uint8_t b) |
| |
A class to control a RGB LED.
The JTKJ HAT includes a common-anode RGB LED driven by PWM on GPIO 18 (R), 19 (G), and 20 (B).
Colors are set with write using 8-bit channels (0 = full on, 255 = off). {@
| RGBLed::RGBLed | ( | uint8_t | pinR, |
| uint8_t | pinG, | ||
| uint8_t | pinB ) |
Construct a new RGBLed object.
| pinR | GPIO pin connected to the red channel |
| pinG | GPIO pin connected to the green channel |
| pinB | GPIO pin connected to the blue channel |
| void RGBLed::write | ( | uint8_t | r, |
| uint8_t | g, | ||
| uint8_t | b ) |
| r | Red channel value (0 = full on, 255 = off) |
| g | Green channel value (0 = full on, 255 = off) |
| b | Blue channel value (0 = full on, 255 = off) |