8 × 24 - LED matrix Display use 74CH595 now i want remove 74ch595 an add max7219

please help me to modify my programme file . i just want remove 74ch595 and use max7219 .
please find the all attachments.
thank you.

1.ino (3.89 KB)

2.ino (1.81 KB)

8x6.ino (5.18 KB)

8x8.ino (5.72 KB)

8x12.ino (9.08 KB)

8x24matrix.ino (4.49 KB)

moving_functions_8x6.ino (4.52 KB)

moving_functions_8x8.ino (4.67 KB)

moving_functions_8x12.ino (5.18 KB)

moving_functions_8x12_2.ino (2.63 KB)

4prasadmalinda12345:
please help me to modify my programme file . i just want remove 74ch595 and use max7219 .
please find the all attachments.
thank you.

1.ino (3.89 KB)

2.ino (1.81 KB)

8x6.ino (5.18 KB)

8x8.ino (5.72 KB)

8x12.ino (9.08 KB)

8x24matrix.ino (4.49 KB)

moving_functions_8x6.ino (4.52 KB)

moving_functions_8x8.ino (4.67 KB)

moving_functions_8x12.ino (5.18 KB)

moving_functions_8x12_2.ino (2.63 KB)

We will help you with the first file, then you can try to do the rest and ask for more help if you need it.

Please post the first file between code tags, not as an attachment.

4prasadmalinda12345:
please help me to modify my program file . i just want remove 74ch595 and use max7219 .

One would hope so. The 74HC595 is essentially useless for such a design. :astonished:

Paul__B: One would hope so. The 74HC595 is essentially useless for such a design. :astonished:

Yes, we told the OP that in their previous topic. They seem to have taken that advice.

A mix of TPIC6B595 to sink current and MIC5891 to source current would be better choice for chips in that setup. I didn't look at the code, the resistor locations would suggest MCC5891 across the top and TPIC6B595 on the side.

Three MAX7219 would have been the better choice to be sure.

THANK YOU VERY MUCH FOR QUICK REPLY, HIGHLY APPRECIATED :) . [u]My code have 10 tabs that the matter any way this is the first file.[/u]

#include 

ShiftRegister74HC595<3> sr1(6, 5, 4);

ShiftRegister74HC595<1> sr2(3, 2, 4);


const int data1 = 6;  // frist shift register's pins

const int str1 = 4;   // the storge register (latch pin) of the all the three shift registers are connected together

const int clock1 = 5; //

const int data2 = 3;  // second shift register's pins

const int clock2 = 2; //

int i = 0, light_intensity = 5;


long t;

boolean a8x6[8][6];

boolean a8x8[8][8];

boolean a8x12[8][12];

boolean t86[8][6];

boolean t88[8][8];

boolean t812[8][12];

boolean a[8][24] = {

{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

};

void setup() {

pinMode(data1, OUTPUT);

pinMode(clock1, OUTPUT);

pinMode(data2, OUTPUT);

pinMode(clock2, OUTPUT);

pinMode(str1, OUTPUT);

}


PROGMEM void loop() {

for (i = 0; i < light_intensity; i++)

a8x8_16();

pt8x8(1, 0 , 0, 1, 75, 100 );

pt8x8(1, 0, 3, 0, 75, 100);

pt8x8(-1, 0, 3, 1, 75, 100);

pt8x8(1, 0, 1, 0, 75, 100);

pt8x8(1, -1, 0, 0, 125, 150  );

pt8x8(1, 0, 0, 1, 65, 150  );

pt8x8(0, 1, 0, 1, 65, 150  );

pt8x8(1, 0, 0, 0, 75, 150 );

pt8x8(0, -1, 0, 1, 75, 50  );

pt8x8(1, 0, 0, 0, 75, 50 );

pt8x8(0, 1, 0, 1, 75, 50 );

pt8x8(0, -1, 2, 1, 75, 50 );

pt8x8(1, -1, 0, 1, 75, 50 );

pt8x8(1, 1, 0, 1, 75, 50 );

a8x8_15();

pt8x8(1, 0 , 0, 1, 75, 100 );

pt8x8(1, 0, 3, 0, 75, 100);

pt8x8(-1, 0, 3, 1, 75, 100);

pt8x8(1, 0, 1, 0, 75, 100);

pt8x8(1, -1, 0, 0, 125, 150  );

pt8x8(1, 0, 0, 1, 65, 150  );

pt8x8(0, 1, 0, 1, 65, 150  );

pt8x8(1, 0, 0, 0, 75, 150 );

pt8x8(0, -1, 0, 1, 75, 50  );

pt8x8(1, 0, 0, 0, 75, 50 );

pt8x8(0, 1, 0, 1, 75, 50 );

pt8x8(0, -1, 2, 1, 75, 50 );

pt8x8(1, -1, 0, 1, 75, 50 );

pt8x8(1, 1, 0, 1, 75, 50 );

a8x8_14();

pt8x8(1, 0 , 0, 1, 75, 100 );

pt8x8(1, 0, 3, 0, 75, 100);

pt8x8(-1, 0, 3, 1, 75, 100);

pt8x8(1, 0, 1, 0, 75, 100);

pt8x8(1, -1, 0, 0, 125, 150  );

pt8x8(1, 0, 0, 1, 65, 150  );

pt8x8(0, 1, 0, 1, 65, 150  );

pt8x8(1, 0, 0, 0, 75, 150 );

pt8x8(0, -1, 0, 1, 75, 50  );

pt8x8(1, 0, 0, 0, 75, 50 );

pt8x8(0, 1, 0, 1, 75, 50 );

pt8x8(0, -1, 2, 1, 75, 50 );

pt8x8(1, -1, 0, 1, 75, 50 );

pt8x8(1, 1, 0, 1, 75, 50 );

a8x8_13();

pt8x8(1, 0 , 0, 1, 75, 100 );

pt8x8(1, 0, 3, 0, 75, 100);

pt8x8(-1, 0, 3, 1, 75, 100);

pt8x8(1, 0, 1, 0, 75, 100);

pt8x8(1, -1, 0, 0, 125, 150  );

pt8x8(1, 0, 0, 1, 65, 150  );

pt8x8(0, 1, 0, 1, 65, 150  );

pt8x8(1, 0, 0, 0, 75, 150 );

pt8x8(0, -1, 0, 1, 75, 50  );

pt8x8(1, 0, 0, 0, 75, 50 );

pt8x8(0, 1, 0, 1, 75, 50 );

pt8x8(0, -1, 2, 1, 75, 50 );

pt8x8(1, -1, 0, 1, 75, 50 );

pt8x8(1, 1, 0, 1, 75, 50 );

a8x12_10();

pt8x12(1, 0, 0, 1, 75, 150);

pt8x12(-1, 0, 0, 1, 75, 150);

pt8x12(0, 1, 0, 1, 75, 150);

pt8x12(0, -1, 0, 1, 75, 150);

pt8x12(1, 1, 0, 1, 75, 150);

pt8x12(-1, -1, 0, 1, 75, 150);

pt8x12(1, 0, 1, 1, 75, 150  );

pt8x12(1, 0, 2, 1, 75, 150);

pt8x12(1, 0, 3, 0, 75, 150 );

pt8x12(1, 0, 0, 0, 75, 150 );

pt8x12_2(1, 0, 1, 1, 75, 150  );

pt8x12_2(1, 0, 2, 1, 75, 150);

pt8x12_2(1, 0, 3, 0, 75, 150 );

pt8x12_2(1, 0, 0, 0, 75, 150 );

a8x8_12();

pt8x8(1, 0 , 0, 1, 75, 100 );

pt8x8(1, 0, 3, 0, 75, 150);

pt8x8(-1, 0, 3, 1, 75, 100);

pt8x8(1, 0, 1, 0, 75, 100);

pt8x8(1, -1, 0, 0, 125, 150  );

pt8x8(1, 0, 0, 1, 65, 150  );

pt8x8(0, 1, 0, 1, 65, 150  );

pt8x8(1, 0, 0, 0, 75, 150 );

pt8x8(0, -1, 0, 1, 75, 50  );

pt8x8(1, 0, 0, 0, 75, 50 );

pt8x8(0, 1, 0, 1, 75, 50 );

pt8x8(0, -1, 2, 1, 75, 50 );

pt8x8(1, -1, 0, 1, 75, 50 );

pt8x8(1, 1, 0, 1, 75, 50 );

}

void display() {

for (byte a2 = 0; a2 < 8; a2++) {

  sr1w(a2);

  sr2w(a2);

  digitalWrite(str1, HIGH);

}

}

void sr1w(byte p) {

digitalWrite(str1, LOW);

for (byte a1 = 0; a1 < 24; a1++) {

  digitalWrite(clock1, LOW);

  if (a[p][a1] == 1) {

    digitalWrite(data1, HIGH);

  }

  else {

    digitalWrite(data1, LOW);

  }

  digitalWrite(clock1, HIGH);

}

}

void sr2w(byte p) {

boolean b[8];

b[0] = HIGH;

b[1] = HIGH;

b[2] = HIGH;

b[3] = HIGH;

b[4] = HIGH;

b[5] = HIGH;

b[6] = HIGH;

b[7] = HIGH;

b[p] = LOW;

digitalWrite(str1, LOW);

for (byte a1 = 0; a1 < 8; a1++) {

  digitalWrite(clock2, LOW);

  if (b[a1]) {

    digitalWrite(data2, HIGH);

  }

  else {

    digitalWrite(data2, LOW);

  }

  digitalWrite(clock2, HIGH);

}

}

void clearmainarray() {

for (int i = 0; i < 8; i++) {

  for (int j = 0; j < 24; j++) {

    a[i][j] = 0;

  }

}

}

PaulRB: We will help you with the first file, then you can try to do the rest and ask for more help if you need it.

Please post the first file between code tags, not as an attachment.

CrossRoads: A mix of TPIC6B595 to sink current and MIC5891 to source current would be better choice for chips in that setup. I didn't look at the code, the resistor locations would suggest MCC5891 across the top and TPIC6B595 on the side.

Three MAX7219 would have been the better choice to be sure.

thanks for advice. my matrix isnt bright as i want thats why am trying to go for a max7219. if i cant modify my code i will try your opinion :) .

CrossRoads: A mix of TPIC6B595 to sink current and MIC5891 to source current would be better choice for chips in that setup. I didn't look at the code, the resistor locations would suggest MCC5891 across the top and TPIC6B595 on the side.

Three MAX7219 would have been the better choice to be sure.

PROGMEM void loop() {

Huh? That looks odd.

CrossRoads: PROGMEM void loop() {

Huh? That looks odd.

tried to save some memory . under the void loop there are many patterns to run. So post here i have deleted some. this code is working 100%. only brightness was the problem.

@4prasadmalinda12345, please learn to use quote tags correctly. What they said goes between the quote tags. What you say goes after the code tags. If you put your words between the quote tags, it looks like they said those words, not you.

Did you write this code? Was it written by a friend or family member?

Please post your schematic showing how you have wired the circuit. Like the one above but with max7219.

PaulRB:
Did you write this code? Was it written by a friend or family member?

Please post your schematic showing how you have wired the circuit. Like the one above but with max7219.

I found above project on internet and this is how am going to wire it with 7219.I didn’t edit any thing in the code for use it with max 7219.

I suggest the next step should be to build the circuit and test it by installing this library and running some of the example scripts.

Once the hardware is working correctly and the library is installed correctly, we will be ready to begin adapting your found code.

I can test it with "proteus’’. this is how i tested example Scollchart in library MD_MAX72xx .

I see.

Well, I am hoping we need only to replace this function:

void display() {

for (byte a2 = 0; a2 < 8; a2++) {

  sr1w(a2);

  sr2w(a2);

  digitalWrite(str1, HIGH);

}

}

PaulRB:
I see.

Well, I am hoping we need only to replace this function:

void display() {

for (byte a2 = 0; a2 < 8; a2++) {

sr1w(a2);

sr2w(a2);

digitalWrite(str1, HIGH);

}

}

thanks paul . i can handle hardware but this coding thing is :cold_sweat: :cold_sweat: :cold_sweat: :cold_sweat: … this is the main reason am here.
you can see with 74ch595 my matrix is not bright. :frowning: :(. can you tell me wht exactly i need to change in code.

I think it would be something like:

void display() {

  for (byte c = 0; c < 24; c++)
    for (byte r = 0; r < 8; r++)
      mx.setPoint(r, c, a[r][c]);
  mx.update();

}

You will also need to copy some lines from the ScrollChart example to your sketch.

#include 
#include 

#define CLK_PIN   13  // or SCK
#define DATA_PIN  11  // or MOSI
#define CS_PIN    10  // or SS
#define HARDWARE_TYPE MD_MAX72XX::PAROLA_HW
#define MAX_DEVICES 3
MD_MAX72XX mx = MD_MAX72XX(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);   

long t;
boolean a8x6[8][6];
boolean a8x8[8][8];
boolean a8x12[8][12];
boolean t86[8][6];
boolean t88[8][8];
boolean t812[8][12];
boolean a[8][24] = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
};

void setup() {


}

void loop() { 
p1(30, 10);
p1(30, 40);
p1(30, 80);

p2(100);
p2(100);
p2(100);
p2(100);
p2(100);
p2(100);
p2(100);
p2(100);
p2(100);
p2(100);

a8x6_1();
pt8x6(1, 0, 0, 1, 75, 50  );
pt8x6(-1, 0, 0, 1, 75, 50);
pt8x6(1, 0, 0, 0, 75, 50 );
pt8x6(1, 0, 0, 0, 75, 50 );
pt8x6(0, 1, 0, 1, 75, 50 );
pt8x6(0, -1, 2, 1, 75, 50 );
pt8x6(1, -1, 0, 1, 75, 50 );

a8x8_1();
pt8x8(1, 0, 0, 1, 75, 50 );
pt8x8(1, 0, 0, 0, 75, 50 );
pt8x8(-1, 0, 1, 1, 75, 50 );
pt8x8(0, 1, 0, 1, 75, 50);
pt8x8(0, -1, 0, 1, 75, 50 );
pt8x8(1, 1, 0, 1, 75, 50);

a8x12_1();
pt8x12(1, 0, 0, 1, 75, 50 );
pt8x12(1, 0, 0, 0, 75, 50);
pt8x12(1, 0, 1, 0, 75, 50 );
pt8x12(0, 1, 0, 1, 75, 50 );

a8x8_2 ();
pt8x8(1, 0, 0, 1, 75, 50);
pt8x8(-1, 0, 0, 1, 75, 50);
pt8x8(0, 1, 0, 1, 75, 50);
pt8x8(1, 1, 0, 1, 75, 50);
pt8x8(-1, -1, 0, 1, 75, 50);

a8x6_2();
pt8x6(1, 0, 0, 1, 75, 50);
pt8x6(1, 0, 0, 0, 75, 50);
pt8x6(1, 1, 0, 1, 75, 50);


a8x12_2();
pt8x12(0, 1, 0, 1, 75, 50);
pt8x12(0, -1, 0, 1, 75, 50);
pt8x12(0, -1, 0, 0, 75, 50);
pt8x12(1, 0, 0, 1, 75, 50);
pt8x12(0, 1, 0, 0, 75, 50);
pt8x12(1, 0, 0, 1, 75, 50);
pt8x12(1, 1, 0, 1, 75, 50);


a8x6_3();
pt8x6(1, 0, 0, 0, 75, 50 );
pt8x6(1, 0, 0, 0, 75, 50 );
pt8x6(0, 1, 0, 1, 75, 50);
pt8x6(0, -1, 0, 1, 75, 50);
pt8x6(0, 1, 0, 0, 75, 50);
pt8x6(0, -1, 0, 0, 75, 50);

a8x12_3();
pt8x12(1, 0, 0, 1, 75, 50);
pt8x12(0, 1, 0, 1, 75, 50);

a8x12_4();
pt8x12(1, 0, 0, 1, 75, 50);
pt8x12(0, 1, 0, 1, 75, 50);

a8x6_4();
pt8x6(1, 0, 0, 1, 75, 50);
pt8x6(-1, 0, 0, 1, 75, 50);
pt8x6(1, 1, 0, 1, 75, 50);

a8x8_3();
pt8x8(1, 0, 0, 1, 75, 50);
pt8x8(-1, 0, 0, 1, 75, 50);
pt8x8(0, 1, 0, 1, 75, 50);
pt8x8(0, -1, 0, 1, 75, 50);


a8x8_4();
pt8x8(1, 0, 0, 1, 75, 50);
pt8x8(-1, 0, 3, 1, 75, 50);
pt8x8(1, 0, 0, 0, 75, 50);
pt8x8(1, 0, 1, 0, 75, 50);


a8x6_5();
pt8x6(0, 1, 0, 1, 75, 50);
pt8x6(0, -1, 0, 1, 75, 50);

a8x12_5();
pt8x12(1, 0, 0, 1, 75, 50);
pt8x12(-1, 0, 0, 1, 75, 50);
pt8x12(0, 1, 0, 1, 75, 50);
pt8x12(0, -1, 0, 1, 75, 50);
pt8x12(1, 1, 0, 1, 75, 50);
pt8x12(-1, -1, 0, 1, 75, 50);

a8x8_5();
pt8x8(1, 1, 0, 1, 75, 50);
pt8x8(-1, -1, 1, 1, 75, 50);


a8x6_6();
pt8x6(1, 0, 0, 0, 75, 100);

}
void display() {

for (byte c = 0; c < 24; c++)
  for (byte r = 0; r < 8; r++)
    mx.setPoint(r, c, a[r][c]);
mx.update();

}

void display2() {
for (byte a2 = 0; a2 < 8; a2++) {
  sr1w(a2);
  sr2w(a2);
  digitalWrite(SS, HIGH);
}
}



void sr1w(byte p) {
digitalWrite(SS, LOW);
for (byte a1 = 0; a1 < 24; a1++) {
  digitalWrite(SCK, LOW);
  if (a[p][a1] == 1) {
    digitalWrite(MOSI, HIGH);
  }
  else {
    digitalWrite(MOSI, LOW);
  }
  digitalWrite(SCK, HIGH);
}
}
void sr2w(byte p) {
boolean b[8];
b[0] = HIGH;
b[1] = HIGH;
b[2] = HIGH;
b[3] = HIGH;
b[4] = HIGH;
b[5] = HIGH;
b[6] = HIGH;
b[7] = HIGH;
b[p] = LOW;
digitalWrite(SS, LOW);
for (byte a1 = 0; a1 < 8; a1++) {

  if (b[a1]) {
    
  }
  else {
  
  }
  
}
}
void clearmainarray() {
for (int i = 0; i < 8; i++) {
  for (int j = 0; j < 24; j++) {
    a[i][j] = 0;
  }
}
}

Forgot how to use code tags? You did it ok in reply #6.