File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
content/hardware/02.hero/boards/uno-r4-wifi/tutorials/led-matrix Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -282,7 +282,29 @@ We have developed a tool that is used to generate frames and animations to be re
282
282
283
283
To use the tool you need to upload the following sketch, allowing the board to read serial inputs send by the browser.
284
284
285
- <CodeBlock url =" https://github.com/arduino/ArduinoCore-renesas/blob/main/libraries/Arduino_LED_Matrix/examples/LivePreview/LivePreview.ino " className =" arduino " />
285
+ ``` arduino
286
+ #include "Arduino_LED_Matrix.h"
287
+
288
+ ArduinoLEDMatrix matrix;
289
+
290
+ void setup() {
291
+ Serial.begin(115200);
292
+ matrix.begin();
293
+ }
294
+
295
+ uint32_t frame[] = {
296
+ 0, 0, 0, 0xFFFF
297
+ };
298
+
299
+ void loop() {
300
+ if(Serial.available() >= 12){
301
+ frame[0] = Serial.read() | Serial.read() << 8 | Serial.read() << 16 | Serial.read() << 24;
302
+ frame[1] = Serial.read() | Serial.read() << 8 | Serial.read() << 16 | Serial.read() << 24;
303
+ frame[2] = Serial.read() | Serial.read() << 8 | Serial.read() << 16 | Serial.read() << 24;
304
+ matrix.loadFrame(frame);
305
+ }
306
+ }
307
+ ```
286
308
287
309
[ Click here] ( https://ledmatrix-editor.arduino.cc ) to go to the LED Matrix tool.
288
310
You can’t perform that action at this time.
0 commit comments