Grove - Chainable RGB LED - Seeed Wiki
https://wiki.seeedstudio.com/Grove-Chainable_RGB_LED/
Download Chainable LED Library
[https://github.com/pjpmarques/ChainableLED] and install it to
Arduino Library. There is the course about how to install
Arduino Library [/How_to_install_Arduino_Library] in wiki page.
Open the example CycleThroughColors by the path:File-
>Examples->ChainableLED_master and upload it to Seeeduino.
1 /*
2 * Example of using the ChainableRGB library for control
3 * This code cycles through all the colors in an uniform
4 */
5
6
7 #include <ChainableLED.h>
8
9 #define NUM_LEDS 5
10
11 ChainableLED leds(7, 8, NUM_LEDS);
12
13 void setup()
14 {
15 leds.init();
16 }
17
18 float hue = 0.0;
19 boolean up = true;
20
21 void loop()
22 {
23 for (byte i=0; i<NUM_LEDS; i++)
24 leds.setColorHSL(i, hue, 1.0, 0.5);
25
26 delay(50);
27
28 if (up)
29 hue+= 0.025;
30 else
31 hue-= 0.025;