Skip to content

Commit fdf83fe

Browse files
corrected 4x4 matrix example code
1 parent 7f2759c commit fdf83fe

File tree

2 files changed

+27
-18
lines changed

2 files changed

+27
-18
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77

88
## [Unreleased]
9+
### Fixed
10+
- Correct the code for the 4x4 matrix example
911

1012
## [1.1.1] - 2018-12-24
1113

examples/rgb-colors-4x4/rgb-colors-4x4.ino

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,36 @@
33
*
44
* This example only works with a 4x4 LED matrix
55
*/
6+
#include <RGBLEDMatrix.h>
67
#include <RGBImage.h>
7-
#include <Screen.h>
8+
#include <Glyph.h>
9+
#include <RGBAnimation.h>
10+
#include <RGBAnimationSequence.h>
811
#include <TimerAction.h>
912

10-
Screen leds(4,4);
13+
RGBLEDMatrix leds(4,4);
1114

1215
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();
2936

3037
leds.startScanning();
3138
}

0 commit comments

Comments
 (0)