ESP32+ILI9341 パラレル通信描画

以下のブログを参考に

ILI9341 + ESP32 (Parallel)

以下のコードを動かす

#include <WiFi.h>
#include "SPI.h"
#include "TFT_eSPI.h"

TFT_eSPI tft = TFT_eSPI();       // Invoke custom library

void setup() {
  tft.init();
  tft.setRotation(1);

  Serial.begin(115200);
  delay(100);
  
  tft.fillScreen(TFT_RED);
}

static uint32_t c = 0;

void loop()
{
  static int s = 0;
  static unsigned long old_time;
  old_time = millis();

  int box = 32;
  
  // put your main code here, to run repeatedly:
  tft.setRotation(1);
  int x, y;
  for(int j = 0;j < 64;j++) {
    x = random(0, 320);
    y = random(0, 240);
    tft.fillRect(x, y, box, box, c);
    tft.drawRect(x, y, box, box, ~c);
    c++;
  }

  Serial.print((float)1/(millis()-old_time)*1000);
  Serial.println(" fps");
}

50 fps くらいで描画される。けど、占有するピン数が多い。速度とピン数はトレードオフ