LED Matrix MX72 19 : how to display 2 digits

Hello,

As i am just a beginner with arduino, i try to figure out a few problems with LED matrix 7219 4 in 1.

I just post a clue to help other beginners https://forum.arduino.cc/index.php?topic=560635.0

But now, i am facing a bigger problem and i would appreciate a bit of help.

I am just trying to put a 2 digit number on this led matrix

I must admit that i am a bit lost

Here is my code:

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

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

#if  DEBUG
#define PRINT(s, x) { Serial.print(F(s)); Serial.print(x); }
#define PRINTS(x) Serial.print(F(x))
#define PRINTD(x) Serial.println(x, DEC)

#else
#define PRINT(s, x)
#define PRINTS(x)
#define PRINTD(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::FC16_HW 
#define MAX_DEVICES  4

#define CLK_PIN   13  // or SCK
#define DATA_PIN  11  // or MOSI
#define CS_PIN    10  // or SS

// SPI hardware interface
MD_MAX72XX mx = MD_MAX72XX(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);

// We always wait a bit between updates of the display
#define  DELAYTIME  100  // in milliseconds



//____________ should be displayed ; A goes from 0 to 30

int NumA;


void showNum(void)

{
  mx.clear();
  mx.update(MD_MAX72XX::OFF);

 for ( NumA=0; NumA<30; NumA++)
  {

 //NumA
    mx.clear(0);

    mx.setChar(COL_SIZE-2, NumA);
      
    mx.update();
    delay(DELAYTIME*2);
  }
  mx.update(MD_MAX72XX::ON);
}


void setup() {


    mx.begin();

#if  DEBUG
  Serial.begin(57600);
#endif
 


void loop() {
  // put your main code here, to run repeatedly:
#if 1

    mx.clear();

  showNum();
    
  #endif
}

And it gives me in hexadecimal but not as figures…

Thanks a lot in advance
damien

The ASCII character for with codes 0 to 9 is not the same as the ASCII character '0' to '9'.

To get '0' to '9', add the code '0' to the number:

char c = i + '0';

Once you get to 2 characters (number > 9) you will need to treat them separately.

So many thanks for your reply

For the moment, i did not succeed to make it work

but i will try to understand what you told me