From ee756f7e231300cdf8e110441e0699a8de1abdfa Mon Sep 17 00:00:00 2001 From: Edvin Date: Tue, 23 Sep 2025 16:25:37 +0200 Subject: First commit --- include/rgb_led.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 include/rgb_led.h (limited to 'include/rgb_led.h') diff --git a/include/rgb_led.h b/include/rgb_led.h new file mode 100644 index 0000000..66eaddc --- /dev/null +++ b/include/rgb_led.h @@ -0,0 +1,25 @@ +typedef struct { + bool R; + bool G; + bool B; +} rgb_color; + +#define rgb_white (rgb_color){ .R = 0, .G = 0, .B = 0 } +#define rgb_yellow (rgb_color){ .R = 0, .G = 0, .B = 1 } +#define rgb_purple (rgb_color){ .R = 0, .G = 1, .B = 0 } +#define rgb_red (rgb_color){ .R = 0, .G = 1, .B = 1 } +#define rgb_cyan (rgb_color){ .R = 1, .G = 0, .B = 0 } +#define rgb_green (rgb_color){ .R = 1, .G = 0, .B = 1 } +#define rgb_blue (rgb_color){ .R = 1, .G = 1, .B = 0 } +#define rgb_black (rgb_color){ .R = 1, .G = 1, .B = 1 } + +typedef struct { + rgb_color color; + int R_pin; + int G_pin; + int B_pin; +} rgb_led; + +void rgb_init_LED(rgb_led *LED, int R_pin, int G_pin, int B_pin); + +void rgb_set_color(rgb_led *LED, rgb_color color); -- cgit v1.2.3