Skip to content

write() in loop causes crash #11

@Lithimlin

Description

@Lithimlin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions