I'm using a max7219 like this one max7219. When I first tested my circuit, I used an 8x8 display and the code worked just fine. Now, after I modified the code with the one that can be found online at arduino code and changed the display with the chained one, the text appears to be mirrored on the matrix display.
Below, I'll attach part of the code. Please help me find the problem.
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
// Define the number of devices we have in the chain and the hardware interface
#define MAX_DEVICES 4
#define CLK_PIN 13
#define DATA_PIN 11
#define CS_PIN 10
// Hardware SPI connection
MD_Parola P = MD_Parola(CS_PIN, MAX_DEVICES);
// Arbitrary output pins
// MD_Parola P = MD_Parola(DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);
void setup(void)
{
P.begin();
P.displayText("Hello", PA_CENTER, 0, 0, PA_PRINT, PA_NO_EFFECT);
}
void loop(void)
{
P.displayAnimate();
}
-
Changing the incorrect line to #define HARDWARE_TYPE MD_MAX72XX::FC16_HW did the trick. It took time to find, but thanks a million!!!mark Hussey– mark Hussey2018年11月15日 01:18:51 +00:00Commented Nov 15, 2018 at 1:18
-
In my case I had to change to #define HARDWARE_TYPE MD_MAX72XX::ICSTATION_HWgramgram– gramgram2021年02月12日 09:14:43 +00:00Commented Feb 12, 2021 at 9:14
4 Answers 4
Since version 3.0 MD_MAX72xx.h
no longer supports that definition. Now the hardware type is defined as a parameter on creation (in the "Example" file you are using - not in MD_MAX72xx.h
)
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
...
MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
Note that I've changed the hardware type from PAROLA_HW
to FC_16
.
Check the configuration in MD_MAX72xx.h file and ensure you have the right module selected.
For example there is a define
#define USE_PAROLA_HW 0
if your hardware is this item then turn off the other hardware settings and turn this one on so it reads as follows:
#define USE_PAROLA_HW 1
there many other settings if it is not there then you will have to experiment until you find the correct one.
In library, change #define USE_GENERIC_HW 0
to #define USE_GENERIC_HW 1
is the solution.
In latest version of #include <MD_Parola.h>
, #include <MD_MAX72xx.h>
you have to define the following and characters will display correctly.
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
-
1Isn't that what @Den1al said in their answer?sempaiscuba– sempaiscuba2018年10月19日 18:31:41 +00:00Commented Oct 19, 2018 at 18:31