File tree 1 file changed +42
-0
lines changed
libraries/Arduino_LED_Matrix/examples/TextWithArduinoGraphics
1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ // To use ArduinoGraphics APIs, please include BEFORE Arduino_LED_Matrix
2
+ #include " ArduinoGraphics.h"
3
+ #include " Arduino_LED_Matrix.h"
4
+
5
+ ArduinoLEDMatrix matrix;
6
+
7
+ void setup () {
8
+ Serial.begin (115200 );
9
+ matrix.begin ();
10
+
11
+ matrix.beginDraw ();
12
+ matrix.stroke (0xFFFFFFFF );
13
+ // add some static text
14
+ // will only show "UNO" (not enough space on the display)
15
+ const char text[] = " UNO r4" ;
16
+ matrix.textFont (Font_4x6);
17
+ matrix.beginText (0 , 1 , 0xFFFFFF );
18
+ matrix.println (text);
19
+ matrix.endText ();
20
+
21
+ matrix.endDraw ();
22
+
23
+ delay (2000 );
24
+ }
25
+
26
+ void loop () {
27
+
28
+ // Make it scroll!
29
+ matrix.beginDraw ();
30
+
31
+ matrix.stroke (0xFFFFFFFF );
32
+ matrix.textScrollSpeed (50 );
33
+
34
+ // add the text
35
+ const char text[] = " Scrolling text! " ;
36
+ matrix.textFont (Font_5x7);
37
+ matrix.beginText (0 , 1 , 0xFFFFFF );
38
+ matrix.println (text);
39
+ matrix.endText (SCROLL_LEFT);
40
+
41
+ matrix.endDraw ();
42
+ }
You can’t perform that action at this time.
0 commit comments