|
3 | 3 | *
|
4 | 4 | * This example only works with a 4x4 LED matrix
|
5 | 5 | */
|
| 6 | +#include <RGBLEDMatrix.h> |
6 | 7 | #include <RGBImage.h>
|
7 |
| -#include <Screen.h> |
| 8 | +#include <Glyph.h> |
| 9 | +#include <RGBAnimation.h> |
| 10 | +#include <RGBAnimationSequence.h> |
8 | 11 | #include <TimerAction.h>
|
9 | 12 |
|
10 |
| -Screen leds(4,4); |
| 13 | +RGBLEDMatrix leds(4,4); |
11 | 14 |
|
12 | 15 | void setup() {
|
13 |
| - leds.pixel(0,0) = WHITE_COLOR; |
14 |
| - leds.pixel(0,1) = RED_COLOR; |
15 |
| - leds.pixel(0,2) = GREEN_COLOR; |
16 |
| - leds.pixel(0,3) = BLUE_COLOR; |
17 |
| - leds.pixel(1,0) = YELLOW_COLOR; |
18 |
| - leds.pixel(1,1) = AQUA_COLOR; |
19 |
| - leds.pixel(1,2) = MAGENTA_COLOR; |
20 |
| - leds.pixel(1,3) = PINK_COLOR; |
21 |
| - leds.pixel(2,0) = ORANGE_COLOR; |
22 |
| - leds.pixel(2,1) = CORAL_COLOR; |
23 |
| - leds.pixel(2,2) = TURQUOISE_COLOR; |
24 |
| - leds.pixel(2,3) = VIOLET_COLOR; |
25 |
| - leds.pixel(3,0) = GRAY_COLOR; |
26 |
| - leds.pixel(3,1) = DARK_GRAY_COLOR; |
27 |
| - leds.pixel(3,2) = LIME_COLOR; |
28 |
| - leds.pixel(3,3) = SLATE_BLUE_COLOR; |
| 16 | + leds.setup(); |
| 17 | + |
| 18 | + leds.startDrawing(); |
| 19 | + leds.image().pixel(0,0) = WHITE_COLOR; |
| 20 | + leds.image().pixel(0,1) = RED_COLOR; |
| 21 | + leds.image().pixel(0,2) = GREEN_COLOR; |
| 22 | + leds.image().pixel(0,3) = BLUE_COLOR; |
| 23 | + leds.image().pixel(1,0) = YELLOW_COLOR; |
| 24 | + leds.image().pixel(1,1) = AQUA_COLOR; |
| 25 | + leds.image().pixel(1,2) = MAGENTA_COLOR; |
| 26 | + leds.image().pixel(1,3) = PINK_COLOR; |
| 27 | + leds.image().pixel(2,0) = ORANGE_COLOR; |
| 28 | + leds.image().pixel(2,1) = CORAL_COLOR; |
| 29 | + leds.image().pixel(2,2) = TURQUOISE_COLOR; |
| 30 | + leds.image().pixel(2,3) = VIOLET_COLOR; |
| 31 | + leds.image().pixel(3,0) = GRAY_COLOR; |
| 32 | + leds.image().pixel(3,1) = DARK_GRAY_COLOR; |
| 33 | + leds.image().pixel(3,2) = LIME_COLOR; |
| 34 | + leds.image().pixel(3,3) = SLATE_BLUE_COLOR; |
| 35 | + leds.stopDrawing(); |
29 | 36 |
|
30 | 37 | leds.startScanning();
|
31 | 38 | }
|
|
0 commit comments