diff --git a/main.c b/main.c index 586a7a4..e254940 100644 --- a/main.c +++ b/main.c @@ -159,6 +159,19 @@ void led_blue(uint16_t bightness) TIM2->CCR1L.reg = (bightness >> 0); // set duty cycle } +void led_rgb(uint8_t* rgb) +{ + if (NULL == rgb) { + return; + } + led_red(rgb[0] << 8); + led_green(rgb[1] << 8); + led_blue(rgb[2] << 8); + // no idea why, but if I don't do it a second time the blue is a bit on when switched off + // it is not about the register order or preload + led_blue(rgb[2] << 8); +} + // configure timer to capture IR NEC codes static void timer_ir_in(void) {