← Back to ratslair.com
aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: f606d829282f0d04dec1741fdadccf738a7a5852 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# `rgb_led`

`rgb_led` is a simple component for ESP32 to control RGB LEDs.

## Colors

- White
- Yellow
- Purple
- Red
- Cyan
- Green
- Blue
- Black

These are addressed as `rgb_[color]`, for example `rgb_white`.

## Example usage

Create an LED variable, say `MY_LED`.

    rgb_led MY_LED;

Initialize it with each corresponding pin.

    rgb_init_LED(&MY_LED, red_pin, green_pin, blue_pin);

And one can then set the color of the LED.

    rgb_set_color(&MY_LED, rgb_purple);