Hallo.
Also der USB Ausgang hat lt. Spec 1.2A max.
Die LED Matrix betreibe ich über den regelbaren Ausgang des Netzteils.
Ich denke nicht das mein Code im generellen ein Problem hat, denn er läuft ja.
Muss man irgendwo noch was einstellen damit mein Programm auf dem Flash des D1 Mini festgeschrieben wird oder so?
Ich denke fast das dies das Problem sein könnte. Aber wie gesagt. Ich bin mir nicht sicher.

Code:
#include <PxMatrix.h>
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>



#ifdef ESP32

#define P_LAT 22
#define P_A 19
#define P_B 23
#define P_C 18
#define P_D 5
#define P_E 15
#define P_OE 2
hw_timer_t * timer = NULL;
portMUX_TYPE timerMux = portMUX_INITIALIZER_UNLOCKED;

#endif

#ifdef ESP8266

#include <Ticker.h>
Ticker display_ticker;
#define P_LAT 16
#define P_A 5
#define P_B 4
#define P_C 15
#define P_D 12
#define P_E 0
#define P_OE 2

#endif
// Pins for LED MATRIX
uint8_t display_draw_time=0;


PxMATRIX display(64,32,P_LAT, P_OE,P_A,P_B,P_C,P_D,P_E);

// Some standard colors
uint16_t myRED = display.color565(255, 0, 0);
uint16_t myGREEN = display.color565(0, 255, 0);
uint16_t myBLUE = display.color565(0, 0, 255);
uint16_t myWHITE = display.color565(255, 255, 255);
uint16_t myYELLOW = display.color565(255, 255, 0);
uint16_t myCYAN = display.color565(0, 255, 255);
uint16_t myMAGENTA = display.color565(255, 0, 255);
uint16_t myBLACK = display.color565(0, 0, 0);

uint8_t ATop = 0;
uint8_t ALeft = 0;
uint8_t BTop = 0;
uint8_t BLeft = 32;
uint8_t CTop = 16;
uint8_t CLeft = 0;
uint8_t DTop = 16;
uint8_t DLeft = 32;

uint16_t myCOLORS[8]={myRED,myGREEN,myBLUE,myWHITE,myYELLOW,myCYAN,myMAGENTA,myBLACK};

 
const char* ssid = "mySSID";
const char* password =  "myPassword";
 
ESP8266WebServer server(80);   //instantiate server at port 80 (http port)

#ifdef ESP8266
// ISR for display refresh
void display_updater(){
  display.display(display_draw_time);
}
#endif

#ifdef ESP32
void IRAM_ATTR display_updater(){
  // Increment the counter and set the time of ISR
  portENTER_CRITICAL_ISR(&timerMux);
  display.display(display_draw_time);
  portEXIT_CRITICAL_ISR(&timerMux);
}
#endif

void display_update_enable(bool is_enable){

#ifdef ESP8266
  if (is_enable)
    display_ticker.attach(0.002, display_updater);
  else
    display_ticker.detach();
#endif

#ifdef ESP32
  if (is_enable)  {
    timer = timerBegin(0, 80, true);
    timerAttachInterrupt(timer, &display_updater, true);
    timerAlarmWrite(timer, 2000, true);
    timerAlarmEnable(timer);
  }  else  {
    timerDetachInterrupt(timer);
    timerAlarmDisable(timer);
  }
#endif

}

void displayIP(String ip){
  display.display(0);
  display.clearDisplay();
  display.setTextSize(1); 
  display.setTextColor(myRED);
  display.setCursor(1,4);
  display.print("IP Adresse");
  display.setTextColor(myWHITE);
  display.setCursor(1,11);
  display.print(ip);
  display_update_enable(true);
  yield();
}

void setup() {
  delay(1000);
 
	WiFi.begin(ssid, password);
 
  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.println("Connecting..");
  }
 
  Serial.print("Connected to WiFi. IP:");
  Serial.println(WiFi.localIP());

  server.begin();      
    
  // Define your display layout here, e.g. 1/8 step
  display.begin(16);
  display.setFastUpdate(true);
  display_draw_time=0;
  displayIP(WiFi.localIP().toString());

}

void loop() {
  server.handleClient();
}