Connecting Max7219/DS1307

Max7219 and DS1307 connection

The problem I have is that there is very little information on the web or the forum about connecting a single or a number of Max7219 8x8 Matrixes with an RTC module (DS1302/1307...).
I have been able to get the Max7219 displaying single letters/numerals and scrolling info across a number of Max7219, and getting a DS1307 to display time and date on 1602/2004 displays, but to connect the two very little or no information can be found, the closet is the Adafruit Ledbackpack but it only works with their sketch/software.
Any help or information with this problem would be greatly welcomed.

but to connect the two very little or no information can be found

What information are you looking for? If you can get the date/time from the clock, and you can display text, what's everything you need to be able to do to display the date and/or time.

Post the code you have, and explain what is/is not working.

What I’m trying to achieve is to display at this stage is the time and date scrolling across the max7219 then to have the time stationary for a set period the back to a scrolling display.
The scrolling display works on its own, and time and date works on its own 1602 shield.
The problem I am having is the combining of the two functions to run on 5xMax7219.
If the letters and numerals are needed to be added for coding, these I have in binary or hex format.

[/#include <SPI.h>
#include <Wire.h>
#include "RTClib.h"
#include <Adafruit_GFX.h>
#include <Max72xxPanel.h>

int pinCS = 10; // Attach CS to this pin, DIN to MOSI and CLK to SCK (cf )
int numberOfHorizontalDisplays = 5;
int numberOfVerticalDisplays = 1;

Max72xxPanel matrix = Max72xxPanel(pinCS, numberOfHorizontalDisplays, numberOfVerticalDisplays);
RTC_DS1307 rtc;

String tape = "The Time is:        The Date is:";   // Need to insert Time and Date inbetween, then after delay Time is shown for a set period then repeated
int wait = 50; // In milliseconds

int spacer = 1;
int width = 5 + spacer; // The font width is 5 pixels

void setup() {
  matrix.setIntensity(0); // Use a value between 0 and 15 for brightness
  #ifdef AVR
  Wire1.begin(); // Shield I2C pins connect to alt I2C bus on Arduino Due
 if (! rtc.isrunning()) {
    matrix.print("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    rtc.adjust(DateTime(__DATE__, __TIME__));

// Adjust to your own needs
//  matrix.setPosition(0, 0, 0); // The first display is at <0, 0>
//  matrix.setPosition(1, 1, 0); // The second display is at <1, 0>
//  matrix.setPosition(2, 2, 0); // The third display is at <2, 0>
//  matrix.setPosition(3, 3, 0); // And the last display is at <3, 0>
//  ...
//  matrix.setRotation(0, 2);    // The first display is position upside down
//  matrix.setRotation(3, 2);    // The same hold for the last display

void loop() {

  for ( int i = 0 ; i < width * tape.length() + matrix.width() - 1 - spacer; i++ ) {


    int letter = i / width;
    int x = (matrix.width() - 1) - i % width;
    int y = (matrix.height() - 8) / 2; // center the text vertically

    while ( x + width - spacer >= 0 && letter >= 0 ) {
      if ( letter < tape.length() ) {
        matrix.drawChar(x, y, tape[letter], HIGH, LOW, 1);

      x -= width;

    matrix.write(); // Send bitmap to display

    DateTime now =;
    matrix.print(now.hour(), DEC);
    matrix.print(now.minute(), DEC);
    matrix.print(now.second(), DEC);
    matrix.print(, DEC);
    matrix.print(now.month(), DEC);
    matrix.print(now.year(), DEC);
    matrix.print(' ');