8x24 LED MATRIX WITH Blue pill

Hai all friends. Following is the main Structure of 8 xc24 LED matrix moving functions are in different tab and it is very large So I share only main structure. In this code I take from internet this code use for Arduino Uno with Single Latch pin (str1 ) . so now I am going to make project this with blue pill board. so I need to use two latch pins . str2 for Row side . I changed some lines of display function and sr1w and sr2w. how ever the entire animation is not display on matrix so please help me to correct where is the issue . Thanks to all


const int data1 = PB9;  // frist shift register's pins
const int str1 = PB8;   
const int clock1 = PB7; 

const int data2 = PB6;  // second shift register's pins
const int clock2 = PB5; 
const int str2 = PB4;

long ct;
boolean z;

boolean a8x6[8][6];
boolean a8x8[8][8];
boolean a8x12[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},
};


boolean n[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(PB9, OUTPUT);
  pinMode(PB8, OUTPUT);
  pinMode(PB7, OUTPUT);
  pinMode(PB6, OUTPUT);
  pinMode(PB5, OUTPUT);
  pinMode(PB4, OUTPUT);
}

void loop() {
// call_to_moving( ud,  lr , al_nr, au_nd, sp, kk)

P24_1();
call_to_moving8x24(1,0,0,0,80,20);//NELUMA

P6_3();

call_to_moving8x6(1,0,0,0,200,1);//MALA
call_to_moving8x6(0,1,0,0,100,20);//MALA


}
void display() {
  for (byte a2 = 0; a2 < 8; a2++) {
    sr1w(a2);
    sr2w(a2);
    digitalWrite(str1, HIGH);
    digitalWrite(str2, HIGH);

  }
}
void sr1w(byte p) {
  digitalWrite(str1, LOW);
  for (byte a1 = 0; a1 < 24; a1++) {
    digitalWrite(clock1, LOW);
    if (a[p][a1] == 1 || n[p][a1] == 1) {
      digitalWrite(data1, LOW);
    }
    else {
      digitalWrite(data1,HIGH);
    }
    digitalWrite(clock1, HIGH);
  }
}
void sr2w(byte p) {
  boolean b[8];
  for (byte i = 0; i < 8; i++) {
    b[i] = HIGH;
  }
  b[p] = LOW;
  digitalWrite(str2, 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 (byte i = 0; i < 8; i++) {
    for (byte j = 0; j < 24; j++) {
      a[i][j] = 0;
      n[i][j] = 0;
    }
  }
}

byte a8x6[6];
byte a8x8[8];
byte a8x12[12];

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.