logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

rgblite.h (593B)


  1. #pragma once
  2. #include "ws2812.h"
  3. #include "color.h"
  4. static inline void rgblite_init(void) {
  5. ws2812_init();
  6. }
  7. static inline void rgblite_setrgb(uint8_t r, uint8_t g, uint8_t b) {
  8. ws2812_set_color_all(r, g, b);
  9. ws2812_flush();
  10. }
  11. static void rgblite_increase_hue(void) {
  12. static uint8_t state = 0;
  13. state = (state + 1) % 3;
  14. switch (state) {
  15. case 1:
  16. rgblite_setrgb(RGB_RED);
  17. break;
  18. case 2:
  19. rgblite_setrgb(RGB_BLUE);
  20. break;
  21. default:
  22. rgblite_setrgb(RGB_GREEN);
  23. break;
  24. }
  25. }