Hi All. I want to display 2 pieces of information on the resident LED matrix.
For a multi-zone temperature control, I want to display 3-digit temperature measurement low down (achieved), with a single LED on the top row indicating which channel that number came from. I have a feeling that I will have to modify arduino_LED_matrix.h and pass an extra parameter from the main.
Please advise
Hi @sbkenn. There is not need to make any modifications to any libraries to accomplish this.
The "Arduino_LED_Matrix" library has support for use with the "ArduinoGraphics" library. The ArduinoGraphics library provides a 4x6 font. This font leaves enough room for the top indicator row you want.
I'll provide a simple sketch that demonstrates how to light an LED on the top row for the indicator, and also print a three digit number below:
// An #include directive for the "ArduinoGraphics" library must be placed before the #include for the "Arduino_LED_Matrix" library.
#include <ArduinoGraphics.h>
#include <Arduino_LED_Matrix.h>
ArduinoLEDMatrix matrix;
void setup() {
matrix.begin();
matrix.textFont(Font_4x6);
matrix.beginDraw();
// `set` is designed to support RGB displays, so has R, G, B parameters. Since the matrix is monochrome, the
// "Arduino_LED_Matrix" library lights the LED when any of the arguments are non-zero.
matrix.set(0, 0, 1, 0, 0);
matrix.endDraw();
// X, Y, then R, G, B
// See comment on `matrix.set` for explanation of the handling of the R, G, B parameters.
matrix.beginText(0, 2, 1, 0, 0);
matrix.print("123");
matrix.endText();
}
void loop() {}
The library also provides a 5x7 font. The numbers actually only use the first six rows, so there is enough vertical space for the indicator row and the text, with an empty row between the two as a separator. However, the matrix doesn't haven enough width for three digits in this font. However, you could use the library's text scrolling feature to still make the full three digits readable. You can configure the sketch to use the 5x7 font by changing this line:
matrix.textFont(Font_4x6);
to this:
matrix.textFont(Font_5x7);
The ArduinoGraphics library defines the character that way in Font_4x6.c, looks to be a simple uncompressed bitmap, so easy to modify if you want a custom font.
// three
(const uint8_t[]){
0b11100000,
0b00100000,
0b01000000,
0b00100000,
0b11000000,
0b00000000,
},
Should I change the digit matrix in the library or turn off LED(10, 2) in the sketch?
Thanks, but I already had that part working. It is the addition of active LEDs to the text display that I an having difficulty with. I suspect that the array is treated as a 104 bit shift register so any addition would shift the text off the array a little. In that case, the dots would have to be added before the text had loaded completely, hence the suggestion of a patch to the matrix library. 25 years ago, I designed and built some large (20charx6 line) LED dotmatrix displays, though I didn't write the (8051) code for them.
At what postion of the LED Matrix you want to see the single LED (x = col: 0 to 12, y = row:0 to 7) turn On?
This guy made a "2x5" (yes, "two by five") numeric font for Uno Q... Create custom font - numbers - #13 by petersin
And more... https://www.micromakerlabs.com/post/blink-led-matrix-intro-for-arduino-uno-q
or 3x7?
It is controlled through charlieplexing:
So we can simply control the state of individual LEDs in the matrix by coordinates.
That is not necessary. I happened to write my code that way, but you can do it in any order you like. You can update specific sections of the matrix without affecting any other parts of the matrix.
If 2x5 was possible, it should be no problem to make a custom 3x7 font. That would be well suited to the matrix on the UNO Q, UNO R4 WiFi, VENTUNO Q, and Modulino LED Matrix.



