MAD 7279 XX Mirror

Bonjour, je viens d’acheter une matrice de 4 fois 8 X 8 MAD7279XX et lorsque je mets l’exemple de la bibliothèque Md_parola scrolling le texte que je rentre est en mode miroir! il me faut un miroir pour le lire normalement lol :slight_smile: et j’aimerais le voire défiler en mode normal ?

Voilà le code ?

y’a t’il une librairie oublié ? ou une ligne de commande pour retourner le texte ! ps: je débute veuillez m’excuser si je m’explique mal :frowning:

Amitié Alain

// Use the Parola library to scroll text on the display
//
// Demonstrates the use of the scrolling function to display text received
// from the serial interface
//
// User can enter text on the serial monitor and this will display as a
// scrolling message on the display.
// Speed for the display is controlled by a pot on SPEED_IN analog in.
// Scrolling direction is controlled by a switch on DIRECTION_SET digital in.
// Invert ON/OFF is set by a switch on INVERT_SET digital in.
//
// UISwitch library can be found at https://github.com/MajicDesigns/MD_UISwitch
// MD_MAX72XX library can be found at GitHub - MajicDesigns/MD_MAX72XX: LED Matrix Library
//

#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>

// set to 1 if we are implementing the user interface pot, switch, etc
#define USE_UI_CONTROL 0

#if USE_UI_CONTROL
#include <MD_UISwitch.h>
#endif

// Turn on debug statements to the serial output
#define DEBUG 0

#if DEBUG
#define PRINT(s, x) { Serial.print(F(s)); Serial.print(x); }
#define PRINTS(x) Serial.print(F(x))
#define PRINTX(x) Serial.println(x, HEX)
#else
#define PRINT(s, x)
#define PRINTS(x)
#define PRINTX(x)
#endif

// 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 HARDWARE_TYPE MD_MAX72XX::PAROLA_HW
#define MAX_DEVICES 4
#define CLK_PIN 13
#define DATA_PIN 11
#define CS_PIN 10

// HARDWARE SPI
MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
// SOFTWARE SPI
//MD_Parola P = MD_Parola(HARDWARE_TYPE, DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);

// Scrolling parameters
#if USE_UI_CONTROL
const uint8_t SPEED_IN = A5;
const uint8_t DIRECTION_SET = 8; // change the effect
const uint8_t INVERT_SET = 9; // change the invert

const uint8_t SPEED_DEADBAND = 5;
#endif // USE_UI_CONTROL

uint8_t scrollSpeed = 25; // default frame delay value
textEffect_t scrollEffect = PA_SCROLL_LEFT;
textPosition_t scrollAlign = PA_LEFT;
uint16_t scrollPause = 2000; // in milliseconds

// Global message buffers shared by Serial and Scrolling functions
#define BUF_SIZE 180
char curMessage[BUF_SIZE] = { “” };
char newMessage[BUF_SIZE] = { "Bonjour les z’amis de la communauté ARDUINO … " };
bool newMessageAvailable = true;

#if USE_UI_CONTROL

MD_UISwitch_Digital uiDirection(DIRECTION_SET);
MD_UISwitch_Digital uiInvert(INVERT_SET);

void doUI(void)
{
// set the speed if it has changed
{
int16_t speed = map(analogRead(SPEED_IN), 0, 1023, 10, 150);

if ((speed >= ((int16_t)P.getSpeed() + SPEED_DEADBAND)) ||
(speed <= ((int16_t)P.getSpeed() - SPEED_DEADBAND)))
{
P.setSpeed(speed);
scrollSpeed = speed;
PRINT("\nChanged speed to ", P.getSpeed());
}
}

if (uiDirection.read() == MD_UISwitch::KEY_PRESS) // SCROLL DIRECTION
{
PRINTS("\nChanging scroll direction");
scrollEffect = (scrollEffect == PA_SCROLL_LEFT ? PA_SCROLL_RIGHT : PA_SCROLL_LEFT);
P.setTextEffect(scrollEffect, scrollEffect);
P.displayClear();
P.displayReset();
}

if (uiInvert.read() == MD_UISwitch::KEY_PRESS) // INVERT MODE
{
PRINTS("\nChanging invert mode");
P.setInvert(!P.getInvert());
}
}
#endif // USE_UI_CONTROL

void readSerial(void)
{
static char *cp = newMessage;

while (Serial.available())
{
*cp = (char)Serial.read();
if ((*cp == ‘\n’) || (cp - newMessage >= BUF_SIZE-2)) // end of message character or full buffer
{
*cp = ‘\0’; // end the string
// restart the index for next filling spree and flag we have a message waiting
cp = newMessage;
newMessageAvailable = true;
}
else // move char pointer to next position
cp++;
}
}

void setup()
{
Serial.begin(57600);
Serial.print("\n[Parola Scrolling Display]\nType a message for the scrolling display\nEnd message line with a newline");

#if USE_UI_CONTROL
uiDirection.begin();
uiInvert.begin();
pinMode(SPEED_IN, INPUT);

doUI();
#endif // USE_UI_CONTROL

P.begin();
P.displayText(curMessage, scrollAlign, scrollSpeed, scrollPause, scrollEffect, scrollEffect);
}

void loop()
{
#if USE_UI_CONTROL
doUI();
#endif // USE_UI_CONTROL

if (P.displayAnimate())
{
if (newMessageAvailable)
{
strcpy(curMessage, newMessage);
newMessageAvailable = false;
}
P.displayReset();
}
readSerial();
}

La librairie PAROLA te permet d’adapter différents afficheurs :

#define HARDWARE_TYPE MD_MAX72XX::PAROLA_HW
// essaie
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
  enum moduleType_t
  {
    PAROLA_HW,    ///< Use the Parola style hardware modules.
    GENERIC_HW,   ///< Use 'generic' style hardware modules commonly available.
    ICSTATION_HW, ///< Use ICStation style hardware module.
    FC16_HW       ///< Use FC-16 style hardware module.
  };

les modules 8x8 hardware parola

les modules generic_HW

les modules FC16_HW

Il faut modifier les lignes ci-dessous dans le fichier de configuration de la bibliothèque master : src/MD_MAX72xx_lib.h

#if USE_PAROLA_HW
//#pragma message “PAROLA HW selected”
#define HW_DIG_ROWS 1 ///< MAX72xx digits are mapped to rows in on the matrix
#define HW_REV_COLS 0 ///< Normal orientation is col 0 on the right. Set to 1 if reversed
#define HW_REV_ROWS 0 ///< Normal orientation is row 0 at the top. Set to 1 if reversed
#endif

Bonjour et merci à tous pour votre aide ! Effectivement je travail avec 4 modules FC16 ! J'ai changé la définition et maintenant j'ai un autre souci ! Le texte s'affiche à l'endroit mais sur chaque module

Essaie l’exemple de la librairie Parola_HelloWorld

Bonjour, Merci pour votre aide, je reviens vers vous avec un peu de retard car j’étais occupé :frowning: … je disais que maintenant j’ai mon inscription qui s’affiche bien mais au lieu de défiler sur les 4 modules comme quand c’était en mode miroir, en remplaçant PAROLA_HW par FC16_HW ça me mets bien à l’endroit! mais sur chaque module ? pourtant j’indique bien 4 modules … je vous mets mon code si vous voyez ou ça cloche ! et encore MERCI mille fois pour votre aide :slight_smile: car là j’arrive pas à m’en sortir seul :frowning:

// Use the Parola library to scroll text on the display
//
// Demonstrates the use of the scrolling function to display text received
// from the serial interface
//
// User can enter text on the serial monitor and this will display as a
// scrolling message on the display.
// Speed for the display is controlled by a pot on SPEED_IN analog in.
// Scrolling direction is controlled by a switch on DIRECTION_SET digital in.
// Invert ON/OFF is set by a switch on INVERT_SET digital in.
//
// UISwitch library can be found at https://github.com/MajicDesigns/MD_UISwitch
// MD_MAX72XX library can be found at GitHub - MajicDesigns/MD_MAX72XX: LED Matrix Library
//
enum moduleType_t
{
PAROLA_HW, ///< Use the Parola style hardware modules.
GENERIC_HW, ///< Use ‘generic’ style hardware modules commonly available.
ICSTATION_HW, ///< Use ICStation style hardware module.
FC16_HW ///< Use FC-16 style hardware module.
};
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>

// set to 1 if we are implementing the user interface pot, switch, etc
#define USE_UI_CONTROL 0

#if USE_UI_CONTROL
#include <MD_UISwitch.h>
#endif

// Turn on debug statements to the serial output
#define DEBUG 0

#if DEBUG
#define PRINT(s, x) { Serial.print(F(s)); Serial.print(x); }
#define PRINTS(x) Serial.print(F(x))
#define PRINTX(x) Serial.println(x, HEX)
#else
#define PRINT(s, x)
#define PRINTS(x)
#define PRINTX(x)
#endif
#define MAX_DEVICES 4
// 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 HARDWARE_TYPE MD_MAX72XX::FC16_HW

#define CLK_PIN 13
#define DATA_PIN 11
#define CS_PIN 10

// HARDWARE SPI
MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
// SOFTWARE SPI
//MD_Parola P = MD_Parola(HARDWARE_TYPE, DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);

// Scrolling parameters
#if USE_UI_CONTROL
const uint8_t SPEED_IN = A5;
const uint8_t DIRECTION_SET = 8; // change the effect
const uint8_t INVERT_SET = 9; // change the invert

const uint8_t SPEED_DEADBAND = 5;
#endif // USE_UI_CONTROL

uint8_t scrollSpeed = 225; // default frame delay value
textEffect_t scrollEffect = PA_SCROLL_LEFT;
textPosition_t scrollAlign = PA_LEFT;
uint16_t scrollPause = 6000; // in milliseconds

// Global message buffers shared by Serial and Scrolling functions
#define BUF_SIZE 120
char curMessage[BUF_SIZE] = { “” };
char newMessage[BUF_SIZE] = { “Les Wheelers sont …” };
bool newMessageAvailable = true;

#if USE_UI_CONTROL

MD_UISwitch_Digital uiDirection(DIRECTION_SET);
MD_UISwitch_Digital uiInvert(INVERT_SET);

void doUI(void)
{
// set the speed if it has changed
{
int16_t speed = map(analogRead(SPEED_IN), 0, 1023, 10, 150);

if ((speed >= ((int16_t)P.getSpeed() + SPEED_DEADBAND)) ||
(speed <= ((int16_t)P.getSpeed() - SPEED_DEADBAND)))
{
P.setSpeed(speed);
scrollSpeed = speed;
PRINT("\nChanged speed to ", P.getSpeed());
}
}

if (uiDirection.read() == MD_UISwitch::KEY_PRESS) // SCROLL DIRECTION
{
PRINTS("\nChanging scroll direction");
scrollEffect = (scrollEffect == PA_SCROLL_LEFT ? PA_SCROLL_RIGHT : PA_SCROLL_LEFT);
P.setTextEffect(scrollEffect, scrollEffect);
P.displayClear();
P.displayReset();
}

if (uiInvert.read() == MD_UISwitch::KEY_PRESS) // INVERT MODE
{
PRINTS("\nChanging invert mode");
P.setInvert(!P.getInvert());
}
}
#endif // USE_UI_CONTROL

void readSerial(void)
{
static char *cp = newMessage;

while (Serial.available())
{
*cp = (char)Serial.read();
if ((*cp == ‘\n’) || (cp - newMessage >= BUF_SIZE-2)) // end of message character or full buffer
{
*cp = ‘\0’; // end the string
// restart the index for next filling spree and flag we have a message waiting
cp = newMessage;
newMessageAvailable = true;
}
else // move char pointer to next position
cp++;
}
}

void setup()
{
Serial.begin(57600);
Serial.print("\n[Parola Scrolling Display]\nType a message for the scrolling display\nEnd message line with a newline");

#if USE_UI_CONTROL
uiDirection.begin();
uiInvert.begin();
pinMode(SPEED_IN, INPUT);

doUI();
#endif // USE_UI_CONTROL

P.begin();
P.displayText(curMessage, scrollAlign, scrollSpeed, scrollPause, scrollEffect, scrollEffect);
}

void loop()
{
#if USE_UI_CONTROL
doUI();
#endif // USE_UI_CONTROL

if (P.displayAnimate())
{
if (newMessageAvailable)
{
strcpy(curMessage, newMessage);
newMessageAvailable = false;
}
P.displayReset();
}
readSerial();

}

hbachetti:
Essaie l'exemple de la librairie Parola_HelloWorld

j'ai essayé et idem :frowning:

Comment les modules sont-ils câblés ?

Bon j’ai trouvé mon souci :slight_smile: En fait je mettais le module FC16 HW et c’était pas celui là ? Mais celui-ci #define HARDWARE_TYPE MD_MAX72XX::ICSTATION_HW pourtant d’après les photos ça ressemblait plus au FC16 :frowning: ce qui m’a enduit en erreur :frowning:

Merci quand même pour votre aide :slight_smile:

hbachetti:
Comment les modules sont-ils câblés ?

MERCI ! j'ai trouvé et en plus de ma faute ! j'avais en tête les modules FC16 et c 'est pas du tout ça ! lol Arff !!! des fois je te jure ! des pieds ds le derrière qui se perdent lol

OK, merci pour le retour.