summaryrefslogtreecommitdiff
path: root/led_test.c
blob: e5aa1f29e18c541342fcfde2dd82a1715db110ff (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
#include <ws2811/ws2811.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#include "led_info.h" 

int main() {
  ws2811_return_t ret;
  if ((ret = ws2811_init(&ledstring)) != WS2811_SUCCESS) {
    printf("Error initilizing ws2811 strip: %s\n", ws2811_get_return_t_str(ret));
    return 1;
  }
  for(;;) {
    for(int i = 0; i < LED_COUNT; i++) {
      ledstring.channel[0].leds[i] = 0xff0000;
      ws2811_render(&ledstring);
    }
    for(int i = 0; i < LED_COUNT; i++) {
      ledstring.channel[0].leds[i] = 0x00ff00;
      ws2811_render(&ledstring);
    }
    for(int i = 0; i < LED_COUNT; i++) {
      ledstring.channel[0].leds[i] = 0x0000ff;
      ws2811_render(&ledstring);
    }
  }
}