R4 Wifi LED Matrix

Hi all
The LED Matrix Documentation works perfectly for most of the samples. Except for the scrolling text documentation. I have updated firmware 0.4.1 IDE 2.3.2 & Board Manager 1.2.0

It says all the relevant (listed below) methods don't exist in the library (and they don't I checked).
Doesn't work in older board versions, either.

Have I missed a step?

#include "Arduino_LED_Matrix.h"

ArduinoLEDMatrix matrix;

  • matrix.beginDraw();
  • matrix.stroke(0xFFFFFFFF);
  • matrix.textFont(Font_4x6);
  • matrix.beginText(0, 1, 0xFFFFFF);
  • matrix.println(text);
  • matrix.endText();
  • matrix.endDraw();

Full code:

#include "Arduino_LED_Matrix.h"

ArduinoLEDMatrix matrix;

void setup() {
  Serial.begin(115200);
  matrix.begin();

  matrix.beginDraw();
  matrix.stroke(0xFFFFFFFF);
  // add some static text
  // will only show "UNO" (not enough space on the display)
  const char text[] = "UNO r4";
  matrix.textFont(Font_4x6);
  matrix.beginText(0, 1, 0xFFFFFF);
  matrix.println(text);
  matrix.endText();

  matrix.endDraw();

  delay(2000);
}

const uint32_t happy[] = {
    0x19819,
    0x80000001,
    0x81f8000
};
const uint32_t heart[] = {
    0x3184a444,
    0x44042081,
    0x100a0040
};
  
void loop(){
  matrix.loadFrame(happy);
  delay(500);

  matrix.loadFrame(heart);
  delay(500);
}

Install the ArduinoGraphics library and try this:

#include <ArduinoGraphics.h>
#include <Arduino_LED_Matrix.h>

ArduinoLEDMatrix matrix;

void setup() {
   matrix.begin();

   matrix.textFont(Font_5x7);
   matrix.textScrollSpeed(100);
   matrix.stroke(0xFF, 0, 0);
   matrix.beginText(0, 1, 0xFF, 0, 0);
   matrix.print("   UNO R4 WiFi");
   matrix.endText(SCROLL_LEFT);
}

const uint32_t happy[] = {
   0x19819,
   0x80000001,
   0x81f8000
};
const uint32_t heart[] = {
   0x3184a444,
   0x44042081,
   0x100a0040
};
  
void loop(){
   matrix.loadFrame(happy);
   delay(500);

   matrix.loadFrame(heart);
   delay(500);
}
2 Likes

The sample code on

https://docs.arduino.cc/tutorials/uno-r4-wifi/led-matrix/

... starts out differently with:

// To use ArduinoGraphics APIs, please include BEFORE Arduino_LED_Matrix
#include "ArduinoGraphics.h"
#include "Arduino_LED_Matrix.h"

ArduinoLEDMatrix matrix;

void setup() {
  Serial.begin(115200);
  matrix.begin();

  matrix.beginDraw();
  matrix.stroke(0xFFFFFFFF);
  // add some static text
  // will only show "UNO" (not enough space on the display)
  const char text[] = "UNO r4";
  matrix.textFont(Font_4x6);
  matrix.beginText(0, 1, 0xFFFFFF);
  matrix.println(text);
  matrix.endText();

  matrix.endDraw();

  delay(2000);
}

void loop() {

  // Make it scroll!
  matrix.beginDraw();

  matrix.stroke(0xFFFFFFFF);
  matrix.textScrollSpeed(50);

  // add the text
  const char text[] = "    Hello World!    ";
  matrix.textFont(Font_5x7);
  matrix.beginText(0, 1, 0xFFFFFF);
  matrix.println(text);
  matrix.endText(SCROLL_LEFT);

  matrix.endDraw();
}

Does it work?

Looks like you are missing the include for this library:

2 Likes

Thanks yes, I didn't see the extra include! I was just copying the setup and loop

2 Likes