Hallo ich habe ein Problem beim anpassen von Werten in einer Library.
Vorab einige Infos:
Verwendetes Board: Mega 2560
Matrix Modul 4 in 1 (also 8x32 Pixel)
Arduino IDE 1.8.5
Da ich dieses Modul als Laufschrift einsetzen möchte, habe ich zum Testen die "Parola" Library benutzt.
Zum austesten habe ich die mitgelieferten Sketche "Parola_Hello-World" etc. benutzt. Auf einigen Websites zu Parola habe ich gelesen das man in der "MD_MAX72XX.h" bestimmte Werte ändern muss damit es mit dem entsprechendem Matrix-Modul funktioniert.
Beispiel:
/**
\def USE_PAROLA_HW
Set to 1 (default) to use the Parola hardware modules. The
software was originally designed to operate with this hardware type.
*/
#define USE_PAROLA_HW 0
/**
\def USE_GENERIC_HW
Set to 1 to use 'generic' hardware modules commonly available, with
connectors at the top and bottom of the PCB, available from many sources.
*/
#define USE_GENERIC_HW 1
/**
\def USE_ICSTATION_HW
Set to 1 to use ICStation DIY hardware module kits available from
http://www.icstation.com/product_info.php?products_id=2609#.UxqVJyxWGHs
This hardware must be set up with the input on the RHS.
*/
#define USE_ICSTATION_HW 0
/**
\def USE_FC16_HW
Set to 1 to use FC16 hardware module kits.
FC16 modules are similar in format to the ICStation modules but are wired differently.
Modules are identified by a FC-16 designation on the PCB
*/
#define USE_FC16_HW 0
/**
\def USE_OTHER_HW
Set to 1 to use other hardware not defined above.
Module 0 (Data In) must be set up on the RHS and the CUSTOM hardware defines
must be set up in the MD_MAD72xx_lib.h file under for this section, using the HW_Mapper
utility to work out what the correct values to use are.
*/
#define USE_OTHER_HW 0
Diese Werte muss man je nach benutzter Hardware (Abhängig vom Hersteller) auf "0" bzw "1" setzten.
Soweit die Theorie...
Ich habe es also wie beschrieben gemacht:
MD_MAX72XX.h mit Editor geöffnet ---> Änderungen gemacht ---> gespeichert ---> Programm in der IDE neu kompiliert ---> auf das Board übertragen. Es tat sich nichts.
Mit dem Befehl #include <MD_MAX72xx.h> (Spitze Klammern) wird doch die "Original"-Library benutzt und mit dem Befehl #include "MD_MAX72xx.h" (Anführungszeichen) wird eine örtliche Kopie der Libray erstellt die man auch mit dem IDE-Befehl "Datei hinzufügen" in einem weiteren Tab öffnen und somit auch leichter bearbeiten kann oder ??
An den Anschlüssen VCC,DIN usw. kann es nicht liegen da ja ältere Programme die noch die "MaxMatrix.h" nutzen laufen.
Was also mache ich falsch? Angeblich soll es ja mit der Parola-Library besser laufen.
Hier noch das "Test-Programm"
// Program to demonstrate the MD_Parola library
//
// Simplest program that does something useful - Hello World!
//
// NOTE: MD_MAX72xx library must be installed and configured for the LED
// matrix type being used. Refer documentation included in the MD_MAX72xx
// library or see this link:
// https://majicdesigns.github.io/MD_MAX72XX/page_hardware.html
//
#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
// NOTE: These pin numbers will probably not work with your hardware and may
// need to be adapted
#define MAX_DEVICES 4
#define CLK_PIN 13
#define DATA_PIN 11
#define CS_PIN 10
#define USE_GENERIC_HW 1
// 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();
}