Hello All
First time poster here.
Been using the MD_parola lib for scrolling text and its working well, including custom fonts that i have made. Many Thanks Marco.
I now would like to display custom STATIC fonts that i have made using this font editor MD_MAX72XX Font Editor, so all good there.
So static font and i can over print them to make some of the 64 leds move, clock face and battery monitor in my case
MY PROBLEM
These fonts are rotated 90 degrees from how they where drawn. I have looked in to the mx.transform(md_max72xx::trc) command but cant work out how to use it.
So the clock face should start with its hands vertical and the battery should be horizontal with the pointed and at the right.
My 4 way matrix has the DATA in on the right hand side and the HARDWARE_TYPE MD_MAX72XX::FC16_HW was worked correctly for all other Parola scrolling text and custom fonts that i have made. I did tyy the other three types but that did not solve the issue.
AM I DOING IT WRONG
I may of course be going about this the totally wrong way?
I say this as i have these two images already in a custom_font.h file but had to convert them in to bytes to try and use them here.
I feel there is an easier way but have not found it yet?
I have looked at the MD_Max72xx_Shift example but that deals with letters and not in my case bytes.
I am also looking into nested loops to reduce the amount of code.
Any help and guidance most welcome
#include <MD_MAX72xx.h>
#include <MD_Parola.h>
#include <SPI.h>
#define delay_t 500 // in milliseconds
// Using a Wemos D1 Mini
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4
#define CLK_PIN 14
#define DATA_PIN 13
#define CS_PIN 15
MD_MAX72XX mx = MD_MAX72XX(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
unsigned char i;
unsigned char j;
// clock face
unsigned char clock1[8][7] = { // row x colums
124, 130, 130, 158, 138, 134, 124,
124, 130, 130, 158, 146, 146, 124,
124, 130, 130, 158, 162, 194, 124,
124, 130, 130, 254, 130, 130, 124,
124, 194, 162, 158, 130, 130, 124,
124, 146, 146, 158, 130, 130, 124,
124, 134, 138, 158, 130, 130, 124,
124, 130, 130, 158, 130, 130, 124,
};
// battery 8x8
unsigned char batt1[8][8] = { // row x columns
252, 132, 132, 132, 132, 132, 204, 120, // 21
252, 252, 132, 132, 132, 132, 204, 120, // 22
252, 252, 252, 132, 132, 132, 204, 120, // 23
252, 252, 252, 252, 132, 132, 204, 120, // 24
252, 252, 252, 252, 252, 132, 204, 120, // 25
252, 252, 252, 252, 252, 252, 204, 120, // 26
252, 252, 252, 252, 252, 252, 252, 120, // 27
};
void setup() {
mx.begin();
mx.control(MD_MAX72XX::INTENSITY, 2);
mx.clear();
}
void loop() {
drawClock();
drawBatt();
}
void drawClock() {
for (j = 1; j <= 7; j++) {
{
for (i = 1; i <= 8; i++)
mx.setRow(0,0,i, clock1[j][i - 1]); //the two zero only will allow the first matrix to light
delay(500);
}
}
mx.clear();
}
void drawBatt() {
// a bit of an issue here as the icons are rotated so my comments may not be true
for (j = 0; j <= 7; j++) { // colunms
{
for (i = 0; i <= 8; i++) //rows
mx.setRow(0,0,i, batt1[j][i]); //the two zero only will allow the first matrix to light
delay(500);
}
}
mx.clear();
delay(10);
}