arduino-Max72xxPanel icon indicating copy to clipboard operation
arduino-Max72xxPanel copied to clipboard

write() in loop causes crash

Open Lithimlin opened this issue 7 years ago • 1 comments

I have the following code. The setup works just fine but as soon as I add the write() into the loop, the program stops completely.

#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Max72xxPanel.h>

#include <Constants.h>

Max72xxPanel matrix = Max72xxPanel(MATRIX_PIN, 1, 1);

void setup() {
  pinMode(BUTTON_ENTER, INPUT);
  Serial.begin(2000000);
  matrix.setIntensity(8);
  matrix.setRotation(0, 3);
  matrix.fillScreen(LOW);
  matrix.drawChar(1, 0, 'S', HIGH, LOW, 1);
  matrix.write();
}

void loop() {
  Serial.println("loop");
  matrix.fillScreen(LOW);
  if(digitalRead(BUTTON_DOWN) == HIGH) {
    matrix.drawChar(1, 0, 'D', HIGH, LOW, 1);
  }
  //matrix.write();
}

I'm not quite sure what causes this. In other programs it works just fine. Only in this one it causes a crash.

Lithimlin avatar Jun 10 '18 13:06 Lithimlin

Does anybody else have this issue?

Lithimlin avatar Jun 15 '19 09:06 Lithimlin