-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathChasseTest.ino
46 lines (36 loc) · 1.12 KB
/
ChasseTest.ino
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
Easy RGB
A simple example that no needs configuration,
just upload the sketch and enjoy the beautiful colors.
by Noteolvides for use with CH55xduino
This example code is in the public domain.
*/
#include <WS2812.h>
#ifdef USER_USB_RAM
#error "This example needs to be compiled with a Default CDC setting"
#error "Tools--> USB Settings--> Default CDC"
#endif
#define NUM_LEDS 6
#define COLOR_PER_LEDS 3
#define NUM_BYTES (NUM_LEDS*COLOR_PER_LEDS)
__xdata uint8_t ledData[NUM_BYTES];
void setup() {
pinMode(34, OUTPUT); //Possible to use other pins.
}
void loop() {
for (uint8_t i = 0; i < NUM_LEDS; i++) {
set_pixel_for_GRB_LED(ledData, i, 50, 0, 0); //Choose the color order depending on the LED you use.
neopixel_show_P3_4(ledData, NUM_BYTES); //Possible to use other pins.
delay(200);
}
for (uint8_t i = 0; i < NUM_LEDS; i++) {
set_pixel_for_GRB_LED(ledData, i, 0, 50, 0);
neopixel_show_P3_4(ledData, NUM_BYTES);
delay(200);
}
for (uint8_t i = 0; i < NUM_LEDS; i++) {
set_pixel_for_GRB_LED(ledData, i, 0, 0, 50);
neopixel_show_P3_4(ledData, NUM_BYTES);
delay(200);
}
}