8000 Update content/hardware/02.hero/boards/uno-r4-wifi/tutorials/r4-wifi-… · opticaldrive/docs-content@1e3588f · GitHub
[go: up one dir, main page]

Skip to content

Commit 1e3588f

Browse files
jacobhylenseaxwi
andauthored
8000
Update content/hardware/02.hero/boards/uno-r4-wifi/tutorials/r4-wifi-getting-started/r4-wifi-getting-started.md
Co-authored-by: seaxwi <71350948+seaxwi@users.noreply.github.com>
1 parent f997752 commit 1e3588f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

content/hardware/02.hero/boards/uno-r4-wifi/tutorials/r4-wifi-getting-started/r4-wifi-getting-started.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ There are several examples available for 8000 the UNO R4 WiFi board, which can be acc
4949
### Tetris Animation Sketch
5050
The UNO R4 WiFi comes preloaded with a Tetris animation. If you've overwritten that sketch and want to restore the board to play the animation again, the sketch can be found here:
5151
```arduino
52+
#include "Arduino_LED_Matrix.h"
53+
#include <stdint.h>
54+
55+
ArduinoLEDMatrix matrix;
56+
5257
const uint32_t frames[][4] = {
5358
{
5459
0xe0000000,
@@ -399,6 +404,24 @@ const uint32_t frames[][4] = {
399404
0xFFFFFFFF
400405
}
401406
};
407+
408+
void setup() {
409+
Serial.begin(115200);
410+
// you can also load frames at runtime, without stopping the refresh
411+
matrix.loadSequence(frames);
412+
matrix.begin();
413+
// turn on autoscroll to avoid calling next() to show the next frame; the paramenter is in milliseconds
414+
// matrix.autoscroll(300);
415+
matrix.play(true);
416+
pinMode(LED_BUILTIN, OUTPUT);
417+
}
418+
419+
void loop() {
420+
digitalWrite(LED_BUILTIN, HIGH);
421+
delay(1000);
422+
digitalWrite(LED_BUILTIN, LOW);
423+
delay(1000);
424+
}
402425
```
403426

404427
## Summary

0 commit comments

Comments
 (0)
0