2dom/PxMatrix

How to reconfigure the display in void setup

KvarTechnologies opened this issue · 0 comments

I tried doing the changes as follows:
in your "Pxmatrix.h" i added this routine
inline void PxMATRIX::reconfigure(uint16_t width, uint16_t height, uint8_t LATCH, uint8_t OE, uint8_t A,uint8_t B,uint8_t C,uint8_t D, uint8_t E){
if(!C==0){
if(!D==0){
if(!E==0){
//a,b,c,d,e
PxMATRIX(width, height, LATCH, OE, A, B,C,D,E);
}else{
//c & D
PxMATRIX(width, height, LATCH, OE, A, B,C,D);
}
}else{
//only c
PxMATRIX(width, height, LATCH, OE, A, B,C);
}
}else{
PxMATRIX(width, height, LATCH, OE, A, B);
}

}

and called the routine in the void setup

PxMATRIX display(32,16,P_LAT, P_OE,P_A,P_B,P_C,P_D); // Pins for LED MATRIX
void setup(){
Serial.begin(9600);
Serial.println("ESP Ready");
eeprom.init();
EEPROM_READ();
sprintf(buff2,"DEVICE ID:%d WIDTH:%d HEIGHT:%d SLABS:%d",devId,width,height,no_of_slab);

Serial2.begin(9600, SERIAL_8N1, RXD2, TXD2);
Serial2.println("Communictaion Port Active");
Serial2.println(buff2);

display.reconfigure(64,16,P_LAT, P_OE,P_A,P_B,P_C,P_D,0);
delay(2000);
display.begin(4);
display.setScanPattern(ZAGZIG);
display.setMuxPattern (BINARY);
display.flushDisplay();
display.setPanelsWidth(1);
display.setBrightness(255);
Serial.println("Display Set");
display.clearDisplay();
display.setCursor(28,0);
display.print("KVAR");
display.setCursor(28,0);
display.print("Tech");
display.setCursor(0,9);
display.setTextColor(Red);
sprintf(buff,"V%.2f ID:%d",ver,devId,DEC);
display.print(buff);
}
it shows the screen like this
WhatsApp Image 2023-02-28 at 10 59 39 AM (1)
WhatsApp Image 2023-02-28 at 10 59 39 AM

Rules

  1. Post your code
  2. Post a picture of the problem and describe what you expect to see
  3. Run the pattern test and post the result as gif/video (need to have a bit more than one full RED/YELLOW/WHITE cycle)
  4. State what version of PxMatrix you are running and what MicroController you use