Simple way to cascade Two Max7219 to display 11 Digits Phone No.

I am new to using Max7219 and I have successfully been able to display 8 Digits “45235678” out of an 11 digit phone "06045235678"no using the “LedControl.h” library.

//We always have to include the library
#include "LedControl.h"

/*
 Now we need a LedControl to work with.
 ***** These pin numbers will probably not work with your hardware *****
 pin 12 is connected to the DataIn 
 pin 11 is connected to the CLK 
 pin 10 is connected to LOAD 
 We have only a single MAX72XX.
 */

LedControl lc=LedControl(12,11,10,1);

/* we always wait a bit between updates of the display */
unsigned long delaytime=2000;

void setup() {
  //we have already set the number of devices when we created the LedControl
  int devices=lc.getDeviceCount();
  //we have to init all devices in a loop
  for(int address=0;address<devices;address++) {
    /*The MAX72XX is in power-saving mode on startup*/
    lc.shutdown(address,false);
    /* Set the brightness to a medium values */
    lc.setIntensity(address,8);
    /* and clear the display */
    lc.clearDisplay(address);
  }
}


/*
 I am displaying the 8 digits of the phone no "45235678"with the code below. 
*/
void writePhoneNumber() {
  lc.setChar(0,7,'5',false);
  lc.setChar(0,6,'2',false);
  lc.setChar(0,5,'3',false);
  lc.setChar(0,4,'5',false);
  lc.setChar(0,3,'5',false);
  lc.setChar(0,2,'6',false);
  lc.setChar(0,1,'7',false);
  lc.setChar(0,0,'8',false);

  delay(delaytime);
  lc.clearDisplay(0);
  delay(delaytime);
} 


void loop() {   
  writePhoneNumber();
}

now trying to cascade the second Max7219 to display the remaining 3 digits “060” so that I can have the complete 11 digits “06045235678” displayed together

will really appreciate suggestions that will help.

Thanks

You are not really saying what is wrong here, but to make 2 of these work you connect Dout of the first to Din of the second to make the comms chain between devices. You also have to let the software know you have 2 of these chained together.

Software-wise, the changes will look something like:

LedControl lc=LedControl(12,11,10,1);

becomes

LedControl lc=LedControl(12,11,10,2);

To provide data to the second 7219 IC and you will add something like this:

lc.setChar(1,7,' ',false);
lc.setChar(1,6,' ',false);
lc.setChar(1,5,' ',false);
lc.setChar(1,4,' ',false);
lc.setChar(1,3,' ',false);
lc.setChar(1,2,'0',false);
lc.setChar(1,1,'6',false);
lc.setChar(1,0,'0',false);

to set the outputs on the second 7219 IC. Depending on which outputs you wire and if you put the digits of the second IC before or after the first.

In addition to daisy-chaining the serial line like Marco said, you will obviously bus the clock and latch lines. If you already have this working with the first IC you mentally have this 95% of the way done even if only physically 50%.

@marco_c : Thanks so much for the hardware solution you provided and thanks to JoeN for providing the software solution .

Working fine now.