source: rtos_arduino/trunk/examples/NCESIoT_RTOS/ChainableLED/examples/FadeInOut/FadeInOut.ino@ 243

Last change on this file since 243 was 243, checked in by ertl-honda, 8 years ago

IoTパッケージの内容に合わせて更新

File size: 477 bytes
Line 
1
2/*
3 * Example of using the ChainableRGB library for controlling a Grove RGB.
4 * This code fades in an out colors in a strip of leds.
5 */
6
7
8#include <ChainableLED.h>
9
10#define NUM_LEDS 5
11
12ChainableLED leds(7, 8, NUM_LEDS);
13
14void setup()
15{
16 leds.init();
17}
18
19byte power = 0;
20
21void loop()
22{
23 for (byte i=0; i<NUM_LEDS; i++)
24 {
25 if (i%2 == 0)
26 leds.setColorRGB(i, power, 0, 0);
27 else
28 leds.setColorRGB(i, 0, 255-power, 0);
29 }
30 power+= 10;
31
32 delay(10);
33}
34
Note: See TracBrowser for help on using the repository browser.