#include <DMD32.h>
#include <fonts/SystemFont5x7.h>
#include <fonts/Arial_Black_16_ISO_8859_1.h>
//Fire up the DMD library as dmd
#define DISPLAYS_ACROSS 1
#define DISPLAYS_DOWN 1
#define LED_BUILTIN 14
DMD dmd(DISPLAYS_ACROSS, DISPLAYS_DOWN);
//Timer setup
//create a hardware timer of ESP32
hw_timer_t * timer = NULL;
void IRAM_ATTR triggerScan()
{
digitalWrite(LED_BUILTIN,HIGH);
dmd.scanDisplayBySPI();
digitalWrite(LED_BUILTIN,LOW);
}
void setup(void)
{
pinMode(PIN_OTHER_SPI_nCS, OUTPUT); //VSPI SS
digitalWrite(PIN_OTHER_SPI_nCS,HIGH);
timer = timerBegin(1000000);
timerAttachInterrupt(timer,&triggerScan);
timerAlarm(timer,1000,true,0);
//clear/init the DMD pixels held in RAM
dmd.clearScreen( false ); //true is normal (all pixels off), false is negative (all pixels on)
Serial.begin(115200);
}
void loop(void)
{
dmd.clearScreen( false );
delay(500);
dmd.clearScreen( true );
delay(500);
}