Line | |
---|
1 | #include "rca.h"
|
---|
2 |
|
---|
3 | #include <ChainableLED.h>
|
---|
4 |
|
---|
5 | #define LED_PIN 4
|
---|
6 |
|
---|
7 | void setup() {
|
---|
8 | pinMode(LED_PIN, OUTPUT);
|
---|
9 | }
|
---|
10 |
|
---|
11 | void loop() {
|
---|
12 | digitalWrite(LED_PIN, HIGH);
|
---|
13 | delay(1000);
|
---|
14 | digitalWrite(LED_PIN, LOW);
|
---|
15 | delay(1000);
|
---|
16 | }
|
---|
17 |
|
---|
18 | #define NUM_LEDS 1
|
---|
19 | ChainableLED leds(8, 9, NUM_LEDS);
|
---|
20 |
|
---|
21 | void task1_setup() {
|
---|
22 | leds.init();
|
---|
23 | }
|
---|
24 |
|
---|
25 | void task1_loop() {
|
---|
26 | int i;
|
---|
27 | for(i = 0; i < 25; i++){
|
---|
28 | leds.setColorRGB(0, i*10, 0, 0);
|
---|
29 | delay(10);
|
---|
30 | }
|
---|
31 | for(i = 25; i > 0; i--){
|
---|
32 | leds.setColorRGB(0, i*10, 0, 0);
|
---|
33 | delay(10);
|
---|
34 | }
|
---|
35 | for(i = 0; i < 25; i++){
|
---|
36 | leds.setColorRGB(0, 0, i*10, 0);
|
---|
37 | delay(10);
|
---|
38 | }
|
---|
39 | for(i = 25; i > 0; i--){
|
---|
40 | leds.setColorRGB(0, 0, i*10, 0);
|
---|
41 | delay(10);
|
---|
42 | }
|
---|
43 | for(i = 0; i < 25; i++){
|
---|
44 | leds.setColorRGB(0, 0, 0, i*10);
|
---|
45 | delay(10);
|
---|
46 | }
|
---|
47 | for(i = 25; i > 0; i--){
|
---|
48 | leds.setColorRGB(0, 0, 0, i*10);
|
---|
49 | delay(10);
|
---|
50 | }
|
---|
51 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.