Bei­spiel­pro­gramm TFT-Display

Lese­zeit: 28 Minu­ten

Vor­schlag für eine Sys­te­ma­tik der SPI-Pins

Lei­der ver­wen­den die Her­stel­ler die unter­schied­lichs­ten Namen für die SPI-Pins. Um etwas Ord­nung in die ver­schie­de­nen Bezeich­nun­gen der SPI-Pins zu brin­gen habe ich mir eine farb­li­che Sys­te­ma­tik überlegt:

Far­ben SPI-Pins

Bezeich­nung SPI-PinFar­be
VCC/LEDArot
GNDschwarz
CSweiß
DC/RS/A0grün
RESET/RES/RSTgelb
CLK/SCK/SCLbraun
COPI/DIN/SDA/SDI (MOSI)blau

Für die ESP-Mikro­con­trol­ler steht die alter­na­ti­ve ⇒Biblio­thek TFT_eSPI zur Verfügung.

Die Biblio­thek Adafruit_GFX

Die Trei­ber aller TFT-Dis­plays ver­wen­den die Biblio­thek Adafruit_GFX.

  • TFT-Dis­play mit 160×128 Pixeln: Adafruit_ST7735
  • TFT-Dis­play mit 320×240 Pixeln:Adafruit_ILI9341
  • TFT-Dis­play mit 240×240 Pixeln: Adafruit_GC9A01A
  • TFT-Dis­play mit 480×320 Pixeln Adafruit_ST7796S_kbv

Funk­tio­nen der Biblio­thek Adafruit_GFX_Library

Schlüs­sel­wortPara­me­terAkti­on
width();Bild­schirm­brei­te feststellen
height();Bild­schirm­hö­he feststellen
setRotation(Richtung);Rich­tung = 0 → nicht drehen
Rich­tung = 1 → 90° drehen
Rich­tung = 2 → 180° drehen
Rich­tung = 3 → 270 ° drehen
Bild­schirm ausrichten
fillScreen(Farbe);Bild­schirm­hin­ter­grund
drawLine(StartX, Star­tY, End­eX, EndeY, Farbe);Linie zeich­nen
drawFastHLine(StartX, Star­tY, Län­ge, Farbe);hori­zon­ta­le Linie zeichnen
drawFastVLine(StartX, Star­tY, Län­ge, Farbe);ver­ti­ka­le Linie zeichnen
drawRect(StartX, Star­tY,, Brei­te, Höhe, Farbe);Recht­eck zeichnen
drawRoundRect(StartX, Star­tY, Brei­te, Höhe, Ecken­ra­di­us, Farbe);abge­run­de­tes Recht­eck zeichnen
fillRoundRect(StartX, Star­tY, Brei­te, Höhe, Ecken­ra­di­us, Füllfarbe);aus­ge­füll­tes abge­run­de­tes Recht­eck zeichnen
fillRect(StartX, Star­tY, Brei­te, Höhe, Füllfarbe);aus­ge­füll­tes Recht­eck zeichnen
drawCircle(MittelpunktX, Mit­tel­punk­tY, Radi­us, Farbe);Kreis zeich­nen
fillCircle(MittelpunktX, Mit­tel­punk­tY, Radi­us, Füllfarbe);Aus­ge­füll­ten Kreis zeichnen
drawTriangle(x1, y1, x2, y2, x3, y3, Farbe);Drei­eck zeichnen:
x1, y1: 1.Punkt
x2, y2: 2.Punkt
x3, y3: 3.Punkt
fillTriangle(x1, y1, x2, y2, x3, y3, Füllfarbe);aus­ge­füll­tes Drei­eck zeichnen:
x1, y1: 1.Punkt
x2, y2: 2.Punkt
x3, y3: 3.Punkt
setCursor(x, y);Cur­sor setzen
setTextSize(Textgröße);Text­grö­ßeText­grö­ße bestimmen
setTextColor(Farbe);Text­far­be setzen
print("Text"); println("Text");Text schrei­ben
setTextWrap(true/false);fal­se → Text fließt über den Rand des TFTs hinaus
true → Text wird am Ende umgebrochen
Zei­len­um­bruch
invert­Dis­play();0 → Far­ben nicht tauschen
1 → Far­ben tauschen
color565(rot, grün, blau);rot: 0 - 255
grün: 0 - 255
blau: 0 - 255
belie­bi­ge Misch­far­ben erstellen
drawBitmap(PosX, PosY, Array, Array­GrößeX, Array­Grö­ßeY, Farbe);Array als Bild darstellen

TFT-Dis­plays mit 160×128 Pixeln

Benö­tig­te Biblio­thek instal­lie­ren.
Instal­lie­re auch die zusätz­lich benö­tig­ten Bibliotheken.

Adafruit Pin­be­le­gung

Pin TFTUNO R3/R4 NanoESP32-WroomWemos D1 Mini/NodeMCUESP32-C6
Gnd (1)GNDGNDGNDGND
VCC (2)5V5V5V5V
RESET (3)84D13
DC (4)92D22
CARD_CS (5)
TFT_CS (6)105D818
COPI/SDO (7)1123D719
SCK (8)1318D521
SDI (9)
LITE (10)5V5V5V5V

1,77 Zoll Pinbelegung

Pin TFTUNO R3/R4 NanoESP32-WroomWemos D1 Mini/NodeMCUESP32-C6XIAO-ESP32-C3
GNDGNDGNDGNDGNDGND
VCC5V5V5V5V5V
SCK1318D521D8
SDA (COPI)1123D719D10
RES (RST)84D13D1
RS (DC)92D22D2
CS105D818D7
LEDA3,3V3,3V3,3V3,3V3,3V

TFT Wavesha­re Pinbelegung

Pin TFTUNO R3/R4 NanoESP32-WroomWemos D1 Mini/NodeMCUESP32-C6XIAO-ESP32-C3
VCC (1)5V5V5V5V5V
GND (2)GNDGNDGNDGNDGND
DIN (3)1123D719D10
CLK (4)1318D521D8
CS (5)105D818D7
DC (6)92D22D2
RST (7)84D13D1
BL (8)5V5V5V5V3,3V

Bei­spiel­pro­gramm

Du musst noch die SPI-Pins an den jewei­li­gen Mikro­con­trol­ler anpassen.

#include "Adafruit_ST7735.h"

// Arduino UNO
// #define TFT_CS       10
// #define TFT_RST       9
// #define TFT_DC        8

// Wemos D1 Mini
// #define TFT_CS       D8
// #define TFT_RST      D1
// #define TFT_DC       D2

// XIAO
// #define TFT_CS       D7
// #define TFT_RST      D1
// #define TFT_DC       D2

// Arduino Nano ESP 32
// #define TFT_CS       10
// #define TFT_RST       9
// #define TFT_DC        8

// ESP32-C6
// #define TFT_CS       18
// #define TFT_RST       3                                          
// #define TFT_DC        2

// ESP32-WROOM
// #define TFT_CS        5
// #define TFT_RST       4 
// #define TFT_DC        2

// Farben
#define SCHWARZ     0x0000
#define WEISS       0xFFFF
#define BLAU        0x001F
#define ROT         0xF800
#define GRUEN       0x07E0
#define CYAN        0x07FF
#define MAGENTA     0xF81F
#define GELB        0xFFE0
#define BRAUN       0x9A60
#define GRAU        0x7BEF
#define GRUENGELB   0xB7E0
#define DUNKELCYAN  0x03EF
#define ORANGE      0xFDA0
#define PINK        0xFE19
#define BORDEAUX    0xA000
#define HELLBLAU    0x867D
#define VIOLETT     0x915C
#define SILBER      0xC618
#define GOLD        0xFEA0

Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);

void setup()
{
  // Zufallsgenerator starten
  randomSeed(analogRead(A0));
  Serial.begin(9600);
  delay(500);
  Serial.println("Bildschirm: " + String(tft.height()) + " x " + String(tft.width()));

  // TFT starten
  tft.initR(INITR_BLACKTAB);

  // Rotation anpassen
  tft.setRotation(0);

  // schwarzer Hintergrund
  tft.fillScreen(SCHWARZ);

  // interne Textdarstellung
  tft.setTextSize(1);
  tft.setCursor(1, 5);
  tft.setTextColor(BLAU);
  tft.print("Text");
  delay(500);

  tft.setTextSize(3);
  tft.setCursor(1, 40);
  tft.setTextColor(GRUEN);
  tft.print("Text");
  delay(500);

  tft.setTextSize(4);
  tft.setCursor(1, 70);
  tft.setTextColor(ROT);
  tft.print("Text");
  delay(2000);

  // Sonderzeichen darstellen
  tft.fillScreen(SCHWARZ);
  tft.setTextColor(WEISS);
  tft.setCursor(1, 20);
  tft.setTextSize(2);

  // Großstädte
  tft.println();
  tft.print("Gro");
  tft.write(0xe);
  tft.print("st");
  tft.write(0x84);
  tft.print("dte");

  // Düsseldorf
  tft.println();
  tft.print("D");
  tft.write(0x81);
  tft.print("sseldorf");

  // Köln
  tft.println();
  tft.print("K");
  tft.write(0x94);
  tft.println("ln");
  tft.println();
  tft.println("Temperatur");
  tft.print("20");
  tft.write(0xf7);
  tft.print("C"); 
  delay(2000);

  // zufällige Pixel
  tft.fillScreen(SCHWARZ);
  for  (int i = 0; i < 700; i++)
  {
    int PixelX = random(1, tft.width());
    int PixelY = random(1, tft.height());
    tft.drawPixel(PixelX, PixelY, tft.color565(random(255),random(255),random(255)));
    delay(5);
  }
  delay(2000);

  // Linien ziehen
  tft.fillScreen(SCHWARZ);
  for (int i = 1; i < tft.height(); i+=10)
  {
    tft.drawLine(1, i, tft.width(), i, ORANGE);
  }
  delay(2000);

  // Kreise vom Mittelpunkt zeichnen
  tft.fillScreen(SCHWARZ);
  for (int i = 1; i < tft.width() / 2; i+=10)
  {
    tft.fillCircle(tft.width() / 2, tft.height() / 2, tft.width() / 2 - i, tft.color565(random(255),random(255),random(255)));
    delay(50);
  }
  delay(2000);

  // Rechtecke zeichnen
  tft.fillScreen(SCHWARZ);
  for (int i = 1; i < tft.width(); i+=10)
  {
    tft.drawRect(tft.width() / 2 - i / 2, tft.height() / 2 - i / 2 , i, i, tft.color565(random(255),random(255),random(255)));
  }
  delay(2000);

   // ausgefüllte Rechtecke zeichnen
  tft.fillScreen(SCHWARZ);
  for (int i = 1; i < tft.width() / 2; i+=10)
  {
    tft.fillRect(i, i, i, i, tft.color565(random(ROT),random(GRUEN),random(BLAU)));
    delay(50);
  }
  delay(2000);

  // Dreiecke
  tft.fillScreen(SCHWARZ);
  for (int i = 1; i <tft.width(); i+=10)
  {
    tft.fillTriangle(i, i, 100, 100, 1, tft.width(), tft.color565(random(255),random(255),random(255)));
    delay(50);
  }   
}

void loop()
{
  // nichts zu tun, das Programm
  // läuft nur einmal
}

TFT-Dis­plays mit 320×240 Pixeln

Benö­tig­te Biblio­thek instal­lie­ren.
Instal­lie­re auch die zusätz­lich benö­tig­ten Bibliotheken.

TFT Wavesha­re Pinbelegung

Pin TFTUNO R3/R4 NanoESP32-WroomWemos D1 Mini/NodeMCUESP32-C6XIAO-ESP32-C3
VCC (1)5V5V5V5V5V
GND (2)GNDGNDGNDGNDGND
DIN (3)1123D719D10
CLK (4)1318D521D8
CS (5)105D818D7
DC (6)92D22D2
RST (7)84D13D1
BL (8)5V5V5V5V3,3V

2,2 Zoll Pinbelegung

Pin TFTUNO R3/R4 NanoESP32-WroomWemos D1 Mini/NodeMCUESP32-C6XIAO-ESP32-C3
SDO
LED3,3V3,3V3,3V3,3V3,3V
SCK1318D521D8
SDI1123D719D10
DC92D22D2
RESET84D13D1
CS105D818D7
GNDGNDGNDGNDGNDGND
VCC5V5V5V5V5V

Bei­spiel­pro­gramm

#include "Adafruit_ILI9341.h"

// Arduino UNO
// #define TFT_CS       10
// #define TFT_RST       9
// #define TFT_DC        8

// Wemos D1 Mini
// #define TFT_CS       D8
// #define TFT_RST      D1
// #define TFT_DC       D2

// XIAO
// #define TFT_CS       D7
// #define TFT_RST      D1
// #define TFT_DC       D2

// Arduino Nano ESP 32
// #define TFT_CS       10
// #define TFT_RST       9
// #define TFT_DC        8

// ESP32-C6
// #define TFT_CS       18
// #define TFT_RST       3                                          
// #define TFT_DC        2

// ESP32-WROOM
// #define TFT_CS        5
// #define TFT_RST       4 
// #define TFT_DC        2

// Farben
#define SCHWARZ     0x0000
#define WEISS       0xFFFF
#define BLAU        0x001F
#define ROT         0xF800
#define GRUEN       0x07E0
#define CYAN        0x07FF
#define MAGENTA     0xF81F
#define GELB        0xFFE0
#define BRAUN       0x9A60
#define GRAU        0x7BEF
#define GRUENGELB   0xB7E0
#define DUNKELCYAN  0x03EF
#define ORANGE      0xFDA0
#define PINK        0xFE19
#define BORDEAUX    0xA000
#define HELLBLAU    0x867D
#define VIOLETT     0x915C
#define SILBER      0xC618
#define GOLD        0xFEA0

Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);

void setup()
{
  // Zufallsgenerator starten
  randomSeed(analogRead(A0));
  Serial.begin(9600);
  delay(500);
  Serial.println("Bildschirm: " + String(tft.height()) + " x " + String(tft.width()));

  // TFT starten
  tft.begin();

  // Rotation anpassen
  tft.setRotation(2);

  // schwarzer Hintergrund
  tft.fillScreen(SCHWARZ);

  // interne Textdarstellung
  tft.setTextSize(1);
  tft.setCursor(1, 5);
  tft.setTextColor(BLAU);
  tft.print("Text");
  delay(500);

  tft.setTextSize(3);
  tft.setCursor(1, 40);
  tft.setTextColor(GRUEN);
  tft.print("Text");
  delay(500);

  tft.setTextSize(5);
  tft.setCursor(1, 70);
  tft.setTextColor(ROT);
  tft.print("Text");
  delay(500);

  tft.setTextSize(7);
  tft.setCursor(1, 120);
  tft.setTextColor(GELB);
  tft.print("Text");
  delay(500);

  tft.setTextSize(9);
  tft.setCursor(1, 200);
  tft.setTextColor(GRAU);
  tft.print("Text");
  delay(2000);

  // Sonderzeichen darstellen
  tft.fillScreen(SCHWARZ);
  tft.setTextColor(WEISS);
  tft.setCursor(10, 20);
  tft.setTextSize(3);

  // Großstädte
  tft.println();
  tft.print("Gro");
  tft.write(0xe);
  tft.print("st");
  tft.write(0x84);
  tft.print("dte");

  // Düsseldorf
  tft.println();
  tft.print("D");
  tft.write(0x81);
  tft.print("sseldorf");

  // Köln
  tft.println();
  tft.print("K");
  tft.write(0x94);
  tft.println("ln");
  tft.println();
  tft.println("Temperatur:");
  tft.print("20");
  tft.write(0xf7);
  tft.print("C"); 
  delay(2000);

  // zufällige Pixel
  tft.fillScreen(SCHWARZ);
  for  (int i = 0; i < 700; i++)
  {
    int PixelX = random(1, tft.width());
    int PixelY = random(1, tft.height());
    tft.drawPixel(PixelX, PixelY, tft.color565(random(255),random(255),random(255)));
    delay(5);
  }
  delay(2000);

  // Linien ziehen
  tft.fillScreen(SCHWARZ);
  for (int i = 1; i < tft.height(); i+=10)
  {
    tft.drawLine(1, i, tft.width(), i, ORANGE);
  }
  delay(2000);

  // Kreise vom Mittelpunkt zeichnen
  tft.fillScreen(SCHWARZ);
  for (int i = 1; i < tft.width() / 2; i+=10)
  {
    tft.fillCircle(tft.width() / 2, tft.height() / 2, tft.width() / 2 - i, tft.color565(random(255),random(255),random(255)));
    delay(50);
  }
  delay(2000);

  // Rechtecke zeichnen
  tft.fillScreen(SCHWARZ);
  for (int i = 1; i < tft.width(); i+=10)
  {
    tft.drawRect(tft.width() / 2 - i / 2, tft.height() / 2 - i / 2 , i, i, tft.color565(random(255),random(255),random(255)));
  }
  delay(2000);

   // ausgefüllte Rechtecke zeichnen
  tft.fillScreen(SCHWARZ);
  for (int i = 1; i < tft.width() / 2; i+=10)
  {
    tft.fillRect(i, i, i, i, tft.color565(random(255),random(255),random(255)));
    delay(50);
  }
  delay(2000);

  // Dreiecke
  tft.fillScreen(SCHWARZ);
  for (int i = 1; i <tft.width(); i+=10)
  {
    tft.fillTriangle(i, i, 100, 100, 1, tft.width(), tft.color565(random(255),random(255),random(255)));
    delay(50);
  }   
}

void loop()
{
  // nichts zu tun, das Programm
  // läuft nur einmal
}

TFT-Dis­play mit 240×240 Pixel

TFT 240×240 Pinbelegung

Pin TFTUNO R3/R4 NanoESP32-WroomESP32-C6Wemos D1 Mini/NodeMCUXIAO-ESP32-C3
VCC3,3V3,3V3,3V3,3V3,3V
GNDGNDGNDGNDGNDGND
SCL (SCK)131821D5D8
SDA (COPI)112319D7D10
DC922D2D2
CS10518D8D7
RST843D1D1

Bei­spiel­pro­gramm

#include "Adafruit_GFX.h"
#include "Adafruit_GC9A01A.h"

// Arduino UNO
// #define TFT_CS       10
// #define TFT_RST       9
// #define TFT_DC        8

// Wemos D1 Mini
// #define TFT_CS       D8
// #define TFT_RST      D1
// #define TFT_DC       D2

// XIAO
// #define TFT_CS       D7
// #define TFT_RST      D1
// #define TFT_DC       D2

// Arduino Nano ESP 32
// #define TFT_CS       10
// #define TFT_RST       9
// #define TFT_DC        8

// ESP32-C6
// #define TFT_CS       18
// #define TFT_RST       3                                          
// #define TFT_DC        2

// ESP32-WROOM
// #define TFT_CS        5
// #define TFT_RST       4 
// #define TFT_DC        2

// Farben
#define SCHWARZ     0x0000
#define WEISS       0xFFFF
#define BLAU        0x001F
#define ROT         0xF800
#define GRUEN       0x07E0
#define CYAN        0x07FF
#define MAGENTA     0xF81F
#define GELB        0xFFE0
#define BRAUN       0x9A60
#define GRAU        0x7BEF
#define GRUENGELB   0xB7E0
#define DUNKELCYAN  0x03EF
#define ORANGE      0xFDA0
#define PINK        0xFE19
#define BORDEAUX    0xA000
#define HELLBLAU    0x867D
#define VIOLETT     0x915C
#define SILBER      0xC618
#define GOLD        0xFEA0

Adafruit_GC9A01A tft(TFT_CS, TFT_DC);

void setup()
{
  // Zufallsgenerator starten
  randomSeed(analogRead(A0));
  Serial.begin(9600);
  delay(500);
  Serial.println("Bildschirm: " + String(tft.height()) + " x " + String(tft.width()));

  // TFT starten
  tft.begin();

  // Rotation anpassen
  tft.setRotation(2);
 
  // schwarzer Hintergrund
  tft.fillScreen(SCHWARZ);

  // interne Textdarstellung
  tft.setTextSize(3);
  tft.setCursor(30, 50);
  tft.setTextColor(BLAU);
  tft.print("Text");
  delay(500);

  tft.setTextSize(4);
  tft.setCursor(30, 80);
  tft.setTextColor(GRUEN);
  tft.print("Text");
  delay(2000);

  // zufällige Pixel
  tft.fillScreen(SCHWARZ);
  for  (int i = 0; i < 700; i++)
  {
    int PixelX = random(1, tft.width());
    int PixelY = random(1, tft.height());
    tft.drawPixel(PixelX, PixelY, tft.color565(random(255),random(255),random(255)));
    delay(5);
  }
  delay(2000);

  // Kreise vom Mittelpunkt zeichnen
  tft.fillScreen(SCHWARZ);
  for (int i = 1; i < tft.width() / 2; i+=5)
  {
    tft.drawCircle(tft.width() / 2, tft.height() / 2, tft.width() / 2 - i, tft.color565(random(255),random(255),random(255)));
    delay(50);
  }
  delay(2000);

  for (int i = 1; i < tft.width() / 2; i+=5)
  {
    tft.drawCircle(tft.width() / 2, tft.height() / 2, tft.width() / 2 - i, SCHWARZ);
    delay(50);
  }
  delay(2000);

  // Kreise vom Mittelpunkt zeichnen
  tft.fillScreen(SCHWARZ);
  for (int i = 1; i < tft.width() / 2; i+=10)
  {
    tft.fillCircle(tft.width() / 2, tft.height() / 2, tft.width() / 2 - i, tft.color565(random(255),random(255),random(255)));
    delay(50);
  }
  delay(2000);

  /*
    alle 30° Linie vom Mittelpunkt zeichnen
    120 = Radius des TFTs (240/2)
    90 = PI/4 (Viertelkreis)
    DEG_TO_RAD (0.0174532925) -> Winkel in Bogenmaß umrechnen
    es ensteht ein Dreieck mit einem Rechten Winkel
    -> Winkelfunktionen sin/cos anwenden
  */
  tft.fillScreen(SCHWARZ);
  for (int i = 0; i < 360; i += 30) 
  {
    float PosX = cos((i - 90) * DEG_TO_RAD) * 120;
    float PosY = sin((i - 90) * DEG_TO_RAD) * 120;
    int PunktX = PosX + 120;
    int PunktY = PosY + 120;
    tft.drawLine(120, 120, PosX + 120, PosY + 120, WEISS);
  }
   delay(2000);
}

void loop()
{
  // nichts zu tun, das Programm
  // läuft nur einmal
}

TFT-Dis­play mit 480×320 Pixeln

4,0 Zoll Pinbelegung

Pin TFTUNO R3/R4/NanoESP32-WroomWemos D1 Mini/NodeMCUESP32-C6XIAO-ESP32-C3
VCC5V5V5V5V5V
GNDGNDGNDGNDGNDGND
CS105D818D7
RESET84D13D1
DC/RS92D22D2
SDI1123D719D10
SCK1318D521D8
LED5V5V5V5V5V

Die ver­wen­de­te Biblio­thek kann nicht über die Biblio­theks­ver­wal­tung instal­liert wer­den. Sie muss her­un­ter gela­den wer­den:
https://​git​hub​.com/​p​r​e​n​t​i​c​e​d​a​v​i​d​/​A​d​a​f​r​u​i​t​_​S​T​7​7​9​6​S​_​kbv
und mit

Sketch -> Biblio­thek ein­bin­den -> zip-Biblio­thek hinzufügen

instal­liert werden.

Bei­spiel­pro­gramm

#include "Adafruit_GFX.h"
#include "Adafruit_ST7796S_kbv.h"

// Arduino UNO
// #define TFT_CS       10
// #define TFT_RST       9
// #define TFT_DC        8

// Wemos D1 Mini
// #define TFT_CS       D8
// #define TFT_RST      D1
// #define TFT_DC       D2

// XIAO
// #define TFT_CS       D7
// #define TFT_RST      D1
// #define TFT_DC       D2

// Arduino Nano ESP 32
// #define TFT_CS       10
// #define TFT_RST       9
// #define TFT_DC        8

// ESP32-C6
// #define TFT_CS       18
// #define TFT_RST       3                                          
// #define TFT_DC        2

// ESP32-WROOM
// #define TFT_CS        5
// #define TFT_RST       4 
// #define TFT_DC        2

Adafruit_ST7796S_kbv tft = Adafruit_ST7796S_kbv(TFT_CS, TFT_DC, TFT_RST);

// Farben
#define SCHWARZ     0x0000
#define WEISS       0xFFFF
#define BLAU        0x001F
#define ROT         0xF800
#define GRUEN       0x07E0
#define CYAN        0x07FF
#define MAGENTA     0xF81F
#define GELB        0xFFE0
#define BRAUN       0x9A60
#define GRAU        0x7BEF
#define GRUENGELB   0xB7E0
#define DUNKELCYAN  0x03EF
#define ORANGE      0xFDA0
#define PINK        0xFE19
#define BORDEAUX    0xA000
#define HELLBLAU    0x867D
#define VIOLETT     0x915C
#define SILBER      0xC618
#define GOLD        0xFEA0

void setup()
{
  // TFT starten
  tft.begin();
  
  // Rotation anpassen
  tft.setRotation(0);

  // wenn die Farben invertiert sind
  // weiß = schwarz, schwarz = weiss ...
  // // entfernen
  // tft.invertDisplay(1);

  // schwarzer Hintergrund
  tft.fillScreen(SCHWARZ);

  // interne Textdarstellung
  tft.setTextSize(1);
  tft.setCursor(1, 5);
  tft.setTextColor(BLAU);
  tft.print("Text");
  delay(500);

  tft.setTextSize(3);
  tft.setCursor(1, 40);
  tft.setTextColor(GRUEN);
  tft.print("Text");
  delay(500);

  tft.setTextSize(5);
  tft.setCursor(1, 70);
  tft.setTextColor(ROT);
  tft.print("Text");

  tft.setTextSize(7);
  tft.setCursor(1, 120);
  tft.setTextColor(ORANGE);
  tft.print("Text");
  delay(2000);

  // Sonderzeichen darstellen
  tft.fillScreen(SCHWARZ);
  tft.setTextColor(WEISS);
  tft.setCursor(1, 20);
  tft.setTextSize(4);

  // Großstädte
  tft.println();
  tft.print("Gro");
  tft.write(0xe);
  tft.print("st");
  tft.write(0x84);
  tft.print("dte");

  // Düsseldorf
  tft.println();
  tft.print("D");
  tft.write(0x81);
  tft.print("sseldorf");

  // Köln
  tft.println();
  tft.print("K");
  tft.write(0x94);
  tft.println("ln");
  tft.println();
  tft.println("Temperatur");
  tft.print("20");
  tft.write(0xf7);
  tft.print("C"); 
  delay(2000);

  // zufällige Pixel
  tft.fillScreen(SCHWARZ);
  for  (int i = 0; i < 700; i++)
  {
    int PixelX = random(1, tft.width());
    int PixelY = random(1, tft.height());
    tft.drawPixel(PixelX, PixelY, tft.color565(random(255),random(255),random(255)));
    delay(5);
  }
  delay(2000);

  // Linien ziehen
  tft.fillScreen(SCHWARZ);
  for (int i = 1; i < tft.height(); i+=10)
  {
    tft.drawLine(1, i, tft.width(), i, ORANGE);
  }
  delay(2000);

  // Kreise vom Mittelpunkt zeichnen
  tft.fillScreen(SCHWARZ);
  for (int i = 1; i < tft.width() / 2; i+=10)
  {
    tft.fillCircle(tft.width() / 2, tft.height() / 2, tft.width() / 2 - i, tft.color565(random(255),random(255),random(255)));
    delay(50);
  }
  delay(2000);

  // Rechtecke zeichnen
  tft.fillScreen(SCHWARZ);
  for (int i = 1; i < tft.width(); i+=10)
  {
    tft.drawRect(tft.width() / 2 - i / 2, tft.height() / 2 - i / 2 , i, i, tft.color565(random(255),random(255),random(255)));
  }
  delay(2000);

   // ausgefüllte Rechtecke zeichnen
  tft.fillScreen(SCHWARZ);
  for (int i = 1; i < tft.width() / 2; i+=10)
  {
    tft.fillRect(i, i, i, i, tft.color565(random(ROT),random(GRUEN),random(BLAU)));
    delay(50);
  }
  delay(2000);

  // Dreiecke
  tft.fillScreen(SCHWARZ);
  for (int i = 1; i <tft.width(); i+=10)
  {
    tft.fillTriangle(i, i, 100, 100, 1, tft.width(), tft.color565(random(255),random(255),random(255)));
    delay(50);
  }   
}

void loop()
{
  // nichts zu tun, das Programm
  // läuft nur einmal
}

Alter­na­ti­ve Bibliothek 

#include "ILI9486_SPI.h"

// Arduino UNO
// #define TFT_CS       10
// #define TFT_RST       9
// #define TFT_DC        8

// Wemos D1 Mini
// #define TFT_CS       D8
// #define TFT_RST      D1
// #define TFT_DC       D2

// XIAO
// #define TFT_CS       D7
// #define TFT_RST      D1
// #define TFT_DC       D2

// Arduino Nano ESP 32
// #define TFT_CS       10
// #define TFT_RST       9
// #define TFT_DC        8

// ESP32-C6
// #define TFT_CS       18
// #define TFT_RST       3                                          
// #define TFT_DC        2

// ESP32-WROOM
// #define TFT_CS        5
// #define TFT_RST       4 
// #define TFT_DC        2

ILI9486_SPI tft(TFT_CS, TFT_DC, TFT_RST);

// Farben
#define SCHWARZ     0x0000
#define WEISS       0xFFFF
#define BLAU        0x001F
#define ROT         0xF800
#define GRUEN       0x07E0
#define CYAN        0x07FF
#define MAGENTA     0xF81F
#define GELB        0xFFE0
#define BRAUN       0x9A60
#define GRAU        0x7BEF
#define GRUENGELB   0xB7E0
#define DUNKELCYAN  0x03EF
#define ORANGE      0xFDA0
#define PINK        0xFE19
#define BORDEAUX    0xA000
#define HELLBLAU    0x867D
#define VIOLETT     0x915C
#define SILBER      0xC618
#define GOLD        0xFEA0

void setup()
{
  tft.setSpiKludge(false); 

  // TFT starten
  tft.init();
  
  // Rotation anpassen
  tft.setRotation(0);

  // wenn die Farben invertiert sind
  // weiß = schwarz, schwarz = weiss ...
  // // entfernen
  // tft.invertDisplay(1); 
  // schwarzer Hintergrund
  tft.fillScreen(SCHWARZ);

  // interne Textdarstellung
  tft.setTextSize(1);
  tft.setCursor(1, 5);
  tft.setTextColor(BLAU);
  tft.print("Text");
  delay(500);

  tft.setTextSize(3);
  tft.setCursor(1, 40);
  tft.setTextColor(GRUEN);
  tft.print("Text");
  delay(500);

  tft.setTextSize(5);
  tft.setCursor(1, 70);
  tft.setTextColor(ROT);
  tft.print("Text");

  tft.setTextSize(7);
  tft.setCursor(1, 120);
  tft.setTextColor(ORANGE);
  tft.print("Text");
  delay(2000);

  // Sonderzeichen darstellen
  tft.fillScreen(SCHWARZ);
  tft.setTextColor(WEISS);
  tft.setCursor(1, 20);
  tft.setTextSize(4);

  // Großstädte
  tft.println();
  tft.print("Gro");
  tft.write(0xe);
  tft.print("st");
  tft.write(0x84);
  tft.print("dte");

  // Düsseldorf
  tft.println();
  tft.print("D");
  tft.write(0x81);
  tft.print("sseldorf");

  // Köln
  tft.println();
  tft.print("K");
  tft.write(0x94);
  tft.println("ln");
  tft.println();
  tft.println("Temperatur");
  tft.print("20");
  tft.write(0xf7);
  tft.print("C"); 
  delay(2000);

  // zufällige Pixel
  tft.fillScreen(SCHWARZ);
  for  (int i = 0; i < 700; i++)
  {
    int PixelX = random(1, tft.width());
    int PixelY = random(1, tft.height());
    tft.drawPixel(PixelX, PixelY, tft.color565(random(255),random(255),random(255)));
    delay(5);
  }
  delay(2000);

  // Linien ziehen
  tft.fillScreen(SCHWARZ);
  for (int i = 1; i < tft.height(); i+=10)
  {
    tft.drawLine(1, i, tft.width(), i, ORANGE);
  }
  delay(2000);

  // Kreise vom Mittelpunkt zeichnen
  tft.fillScreen(SCHWARZ);
  for (int i = 1; i < tft.width() / 2; i+=10)
  {
    tft.fillCircle(tft.width() / 2, tft.height() / 2, tft.width() / 2 - i, tft.color565(random(255),random(255),random(255)));
    delay(50);
  }
  delay(2000);

  // Rechtecke zeichnen
  tft.fillScreen(SCHWARZ);
  for (int i = 1; i < tft.width(); i+=10)
  {
    tft.drawRect(tft.width() / 2 - i / 2, tft.height() / 2 - i / 2 , i, i, tft.color565(random(255),random(255),random(255)));
  }
  delay(2000);

   // ausgefüllte Rechtecke zeichnen
  tft.fillScreen(SCHWARZ);
  for (int i = 1; i < tft.width() / 2; i+=10)
  {
    tft.fillRect(i, i, i, i, tft.color565(random(ROT),random(GRUEN),random(BLAU)));
    delay(50);
  }
  delay(2000);

  // Dreiecke
  tft.fillScreen(SCHWARZ);
  for (int i = 1; i <tft.width(); i+=10)
  {
    tft.fillTriangle(i, i, 100, 100, 1, tft.width(), tft.color565(random(255),random(255),random(255)));
    delay(50);
  }  
}

void loop()
{
  // nichts zu tun, das Programm läuft nur einmal
}

Son­der­zei­chen anzeigen

Die Stan­dard­schrif­ten kön­nen kei­ne Umlau­te und Son­der­zei­chen anzei­gen, sie müs­sen als hexa­de­zi­ma­ler oder dezi­ma­ler Code ein­ge­ge­ben werden.

Zei­chenHex-CodeDezi­mal-Code
ä0×84132
ö0×94148
ü0×81129
Ä0x8e142
Ö0×99153
Ü0x9a154
ß0xe0224
°0xf7247
α0xdf223
π0xe2226
Ω0xe9233
Σ0xe3227
0xed237
|0xad173
  tft.write(0x84);  // ä 132
  tft.write(0x94);  // ö 148
  tft.write(0x81);  // ü 129
  tft.write(0x8e);  // Ä 142
  tft.write(0x99);  // Ö 153
  tft.write(0x9a);  // Ü 154
  tft.write(0xe0);  // ß 224
  tft.println();
  tft.write(0xdf);  // α 223
  tft.write(0xe2);  // π 226
  tft.write(0xe3);  // Σ 227
  tft.write(0xe9);  // Ω 233
  tft.write(0xad);  // | 173
  tft.write(0xae);  // Doppelpfeil links 174
  tft.write(0xaf);  // Doppelpfeil rechts 175
  tft.write(0xf7);  // ° 247
  tft.write(0xed);  // € 237
  
  // Beispiele
  // Großstädte
  tft.println();
  tft.print("Gro");
  tft.write(0xe);
  tft.print("st");
  tft.write(0x84);
  tft.print("dte");

  // Düsseldorf
  tft.println();
  tft.print("D");
  tft.write(0x81);
  tft.print("sseldorf");

  // Köln
  tft.println();
  tft.print("K");
  tft.write(0x94);
  tft.print("ln");

Wenn du den dezi­ma­len Code ver­wen­den willst:

  tft.write(char(132));  // ä
  tft.write(char(148));  // ö
  tft.write(char(129));  // ü

Alle Son­der­zei­chen anzeigen:

  for (int i = 128; i < 256; i++)
  {
    tft.write(char(i));
  }

Schrif­ten mit der Biblio­thek Adafruit_GFX

Die Biblio­thek Adafruit_GFX bie­tet auch ver­schie­de­ne Schrif­ten an. Sie befin­den sich im Ord­ner libraries/Adafruit_GFX_Library/Fonts. Lei­der bie­ten sie nur den ein­fa­chen ASCII-Zei­chen­satz, Umlau­te und Son­der­zei­chen feh­len.
Im Kopf des Pro­gramms müs­sen die ver­wen­de­ten Schrif­ten ein­ge­bun­den wer­den, set­Font defi­niert die ent­spre­chen­de Schriftart.

Bei­spiel:

#include "Adafruit_ILI9341.h"

// alle Schriftarten einbinden
#include "Fonts/FreeMono9pt7b.h"	
#include "Fonts/FreeMono12pt7b.h"
#include "Fonts/FreeMono18pt7b.h"
#include "Fonts/FreeMono24pt7b.h"

#include "Fonts/FreeMonoBold9pt7b.h"		
#include "Fonts/FreeMonoBold12pt7b.h"
#include "Fonts/FreeMonoBold18pt7b.h"
#include "Fonts/FreeMonoBold24pt7b.h"	

#include "Fonts/FreeMonoBoldOblique9pt7b.h"
#include "Fonts/FreeMonoBoldOblique12pt7b.h"	
#include "Fonts/FreeMonoBoldOblique18pt7b.h"
#include "Fonts/FreeMonoBoldOblique24pt7b.h"	

#include "Fonts/FreeMonoOblique9pt7b.h"
#include "Fonts/FreeMonoOblique12pt7b.h"
#include "Fonts/FreeMonoOblique18pt7b.h"
#include "Fonts/FreeMonoOblique24pt7b.h"

#include "Fonts/FreeSans9pt7b.h"	
#include "Fonts/FreeSans12pt7b.h"
#include "Fonts/FreeSans18pt7b.h"	
#include "Fonts/FreeSans24pt7b.h"	

#include "Fonts/FreeSansBold9pt7b.h"
#include "Fonts/FreeSansBold12pt7b.h"
#include "Fonts/FreeSansBold18pt7b.h"	
#include "Fonts/FreeSansBold24pt7b.h"

#include "Fonts/FreeSerif9pt7b.h"	
#include "Fonts/FreeSerif12pt7b.h"
#include "Fonts/FreeSerif18pt7b.h"	
#include "Fonts/FreeSerif24pt7b.h"	

#include "Fonts/FreeSerifBold9pt7b.h"
#include "Fonts/FreeSerifBold12pt7b.h"
#include "Fonts/FreeSerifBold18pt7b.h"	
#include "Fonts/FreeSerifBold24pt7b.h"

// Wemos D1 Mini
// #define TFT_CS       D8
// #define TFT_RST      D1
// #define TFT_DC       D2

// XIAO
// #define TFT_CS       D7
// #define TFT_RST      D1
// #define TFT_DC       D2

// Arduino Nano ESP 32
// #define TFT_CS       10
// #define TFT_RST       9
// #define TFT_DC        8


// SPI-Pins ESP32-C6
// #define TFT_CS       18
// #define TFT_RST       3                                          
// #define TFT_DC        2

// ESP32-WROOM
// #define TFT_CS        5
// #define TFT_RST       4
// #define TFT_DC        2

Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);

// Farben
#define SCHWARZ     0x0000
#define WEISS       0xFFFF
#define BLAU        0x001F
#define ROT         0xF800
#define GRUEN       0x07E0
#define CYAN        0x07FF
#define MAGENTA     0xF81F
#define GELB        0xFFE0
#define BRAUN       0x9A60
#define GRAU        0x7BEF
#define GRUENGELB   0xB7E0
#define DUNKELCYAN  0x03EF
#define ORANGE      0xFDA0
#define PINK        0xFE19
#define BORDEAUX    0xA000
#define HELLBLAU    0x867D
#define VIOLETT     0x915C
#define SILBER      0xC618
#define GOLD        0xFEA0

void setup()
{
  tft.begin();
  tft.fillScreen(SCHWARZ);

  tft.setTextColor(WEISS);
  tft.setFont(&FreeSerif24pt7b);  
  tft.setCursor(1, 40);
  tft.print("Serif 24pt");

  tft.setTextColor(BORDEAUX);
  tft.setFont(&FreeSans24pt7b);  
  tft.setCursor(1, 100);
  tft.print("Sans 24pt");

  tft.setTextColor(PINK);
  tft.setFont(&FreeSerif18pt7b);  
  tft.setCursor(1, 140);
  tft.print("Serif 18pt");

  tft.setTextColor(GRUEN);
  tft.setFont(&FreeSans18pt7b);  
  tft.setCursor(1, 180);
  tft.print("Sans 18pt");
 
  tft.setTextColor(MAGENTA);
  tft.setFont(&FreeSerif12pt7b);  
  tft.setCursor(1, 210);
  tft.print("Serif 12pt");

  tft.setTextColor(ROT);
  tft.setFont(&FreeSans12pt7b);  
  tft.setCursor(1, 240);
  tft.print("Sans 12pt");

  tft.setTextColor(ORANGE);
  tft.setFont(&FreeSerif9pt7b);  
  tft.setCursor(1, 270);
  tft.print("Serif 9pt");

  tft.setTextColor(GELB);
  tft.setFont(&FreeSans9pt7b);  
  tft.setCursor(1, 300);
  tft.print("Sans 9pt");
}

void loop()
{
  // bleibt leer, Programm läuft nur einmal
}

Schrif­ten erstellen

Auf der Sei­te https://​rop​.nl/​t​r​u​e​t​y​p​e​2​g​fx/ kannst du von den ver­füg­ba­ren frei­en Schrift­ar­ten neue Schrift­grö­ßen erstel­len. Aller­dings ver­wen­den die­se Schrif­ten auch nur den ein­fa­chen ASCII-Zeichensatz.

Die neu erstell­te Schrift befin­det sich anschlie­ßend in dei­nem Down­load-Ord­ner. Jetzt musst du sie noch in den Ordner 

Arduino/libraries/Adafruit_GFX_Library/Fonts

kopie­ren.

So sieht es auf einem TFT mit 320×240 Pixeln aus:

#include "Adafruit_ILI9341.h"

#include "Fonts/FreeSans60pt7b.h"

// Wemos D1 Mini
// #define TFT_CS       D8
// #define TFT_RST      D1
// #define TFT_DC       D2

// XIAO
// #define TFT_CS       D7
// #define TFT_RST      D1
// #define TFT_DC       D2

// Arduino Nano ESP 32
// #define TFT_CS       10
// #define TFT_RST       9
// #define TFT_DC        8


// ESP32-C6
// #define TFT_CS       18
// #define TFT_RST       3                                          
// #define TFT_DC        2

// ESP32-WROOM
// #define TFT_CS        5
// #define TFT_RST       4 
// #define TFT_DC        2

Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);

#define SCHWARZ 0x0000     // dezimal 0
#define WEISS 0xFFFF       // dezimal 65535

void setup()
{
  tft.begin();
  tft.setRotation(1);  
  tft.fillScreen(SCHWARZ);
  tft.setTextColor(WEISS);
  tft.setFont(&FreeSans60pt7b);  
  tft.setCursor(1, 100);
  tft.print("Sans");
  tft.setCursor(1, 200);
  tft.println("60pt");
}

void loop()
{
  // bleibt leer, Programm läuft nur einmal
}

Zusätz­li­che Schrif­ten mit der Biblio­thek U8g2_for_Adafruit_GFX

Die Biblio­thek U8g2_for_Adafruit_GFX Biblio­thek bie­tet eine Viel­zahl von Schrif­ten in ver­schie­de­nen Grö­ßen. Am Namen der Schrift­art kannst du able­sen wel­che ASCII-Zei­chen dar­ge­stellt wer­den können.

u8g2_for_AdafruitGFX Zei­chen­satz

Zei­chen­satzBeschrei­bung
rASCII-Zei­chen zwi­schen 30 und 127
ent­hält alle Zah­len, Groß und Kleinbuchstaben
fASCII-Zei­chen zwi­schen 30 und 255
erwei­ter­ter Zei­chen­satz mit Sym­bo­len und Umlauten
uASCII-Zei­chen zwi­schen 32 und 95 
Großbuchstaben
nASCII-Zei­chen zwi­schen 30 und 39
Zah­len und Satzzeichen

Bit­maps darstellen

Array des Bit­maps erstellen

Bit­maps kön­nen nicht direkt auf dem Dis­play dar­ge­stellt wer­den, sie müs­sen als Array hexa­de­zi­ma­ler Wer­te vor­lie­gen.
Wäh­le oder erstel­le ein Bild mit den maxi­ma­len Maßen 200×200 Pixeln. Das Online-Tool 🔗https://​javl​.git​hub​.io/​i​m​a​g​e​2​c​pp/ wan­delt das Bild in ein Array um.

Der Spei­cher­platz des Ardui­no UNO reicht für das Pro­gramm nicht aus.

Das erstell­te Array muss in den Kopf des Pro­gramms ein­ge­fügt wer­den.
draw­Bit­map zeigt das Bild an.

Ab Zei­le 4 musst du die ent­spre­chen­den SPI-Pins des ver­wen­de­ten Mikro­con­trol­lers auswählen.

#include "Adafruit_ILI9341.h"
#include "U8g2_for_Adafruit_GFX.h"

// Wemos D1 Mini
// #define TFT_CS       D8
// #define TFT_RST      D1
// #define TFT_DC       D2

// XIAO
// #define TFT_CS       D7
// #define TFT_RST      D1
// #define TFT_DC       D2

// Arduino Nano ESP 32
// #define TFT_CS       10
// #define TFT_RST       9
// #define TFT_DC        8


// ESP32-C6
// #define TFT_CS       18
// #define TFT_RST       3                                          
// #define TFT_DC        2

// ESP32-WROOM
// #define TFT_CS        5
// #define TFT_RST       4 
// #define TFT_DC        2

// Farben
#define SCHWARZ     0x0000
#define WEISS       0xFFFF
#define BLAU        0x001F
#define ROT         0xF800
#define GRUEN       0x07E0
#define CYAN        0x07FF
#define MAGENTA     0xF81F
#define GELB        0xFFE0
#define BRAUN       0x9A60
#define GRAU        0x7BEF
#define GRUENGELB   0xB7E0
#define DUNKELCYAN  0x03EF
#define ORANGE      0xFDA0
#define PINK        0xFE19
#define BORDEAUX    0xA000
#define HELLBLAU    0x867D
#define VIOLETT     0x915C
#define SILBER      0xC618
#define GOLD        0xFEA0

Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);

// Objekt u8g2Schriften
U8G2_FOR_ADAFRUIT_GFX u8g2Schriften;

// Bitmaps
const unsigned char Uhr [] PROGMEM = {
	// 'Uhr, 80x80px
	0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 
	0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 
	0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xc0, 
	0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 
	0xe0, 0x07, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfc, 0x00, 0x00, 0x3f, 0xfe, 0x00, 0x00, 
	0x00, 0x01, 0xff, 0xf0, 0x00, 0x00, 0x07, 0xff, 0x80, 0x00, 0x00, 0x03, 0xff, 0x80, 0x00, 0x00, 
	0x01, 0xff, 0xc0, 0x00, 0x00, 0x07, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xe0, 0x00, 0x00, 0x0f, 
	0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xf0, 0x00, 0x00, 0x1f, 0xf0, 0x00, 0x03, 0xc0, 0x00, 0x0f, 
	0xf8, 0x00, 0x00, 0x3f, 0xe0, 0x00, 0x03, 0xc0, 0x00, 0x07, 0xfc, 0x00, 0x00, 0x7f, 0xc0, 0x00, 
	0x01, 0x80, 0x00, 0x03, 0xfe, 0x00, 0x00, 0xff, 0x80, 0x70, 0x00, 0x00, 0x0e, 0x01, 0xff, 0x00, 
	0x00, 0xff, 0x00, 0x70, 0x00, 0x00, 0x0e, 0x00, 0xff, 0x00, 0x01, 0xfe, 0x00, 0x70, 0x00, 0x00, 
	0x0e, 0x00, 0x7f, 0x80, 0x03, 0xfc, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x3f, 0xc0, 0x03, 0xf8, 
	0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x1f, 0xc0, 0x07, 0xf0, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 
	0x0f, 0xe0, 0x07, 0xf0, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x0f, 0xe0, 0x00, 0x00, 
	0x01, 0x80, 0x00, 0x00, 0x07, 0xf0, 0x0f, 0xc0, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x03, 0xf0, 
	0x1f, 0xc0, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x03, 0xf8, 0x1f, 0x80, 0xe0, 0x00, 0x01, 0x80, 
	0x00, 0x03, 0x81, 0xf8, 0x3f, 0x80, 0xe0, 0x00, 0x01, 0x80, 0x00, 0x03, 0x81, 0xfc, 0x3f, 0x80, 
	0xe0, 0x00, 0x01, 0x80, 0x00, 0x03, 0x81, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 
	0x00, 0xfc, 0x7f, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0xfe, 0x7e, 0x00, 0x00, 0x00, 
	0x01, 0x80, 0x00, 0x00, 0x00, 0x7e, 0x7e, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x7e, 
	0x7e, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x7e, 0x7e, 0x00, 0x00, 0x00, 0x01, 0x80, 
	0x00, 0x00, 0x00, 0x7e, 0xfe, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x7f, 0xfc, 0x00, 
	0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 
	0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x0c, 0x00, 0x00, 
	0x01, 0x80, 0x00, 0x00, 0x30, 0x3f, 0xfc, 0x1c, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x78, 0x3f, 
	0xfc, 0x1c, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x78, 0x3f, 0xfc, 0x0c, 0x00, 0x00, 0x1f, 0x80, 
	0x00, 0x00, 0x30, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 
	0x00, 0x01, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x03, 0xe0, 0x00, 0x00, 0x00, 
	0x00, 0x3f, 0xfe, 0x00, 0x00, 0x0f, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x7e, 0x00, 0x00, 0x3f, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x7e, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 
	0x7e, 0x00, 0x01, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x7e, 0x00, 0x07, 0xe0, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x7e, 0x7f, 0x00, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 
	0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0x01, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x03, 
	0x80, 0xfc, 0x3f, 0x81, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x03, 0x81, 0xfc, 0x1f, 0x80, 0xc0, 0x00, 
	0x00, 0x00, 0x00, 0x03, 0x81, 0xf8, 0x1f, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xf8, 
	0x0f, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xf0, 0x0f, 0xe0, 0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x07, 0xf0, 0x07, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xe0, 0x07, 0xf0, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xe0, 0x03, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
	0x1f, 0xc0, 0x03, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xc0, 0x01, 0xfe, 0x00, 0x70, 
	0x00, 0x00, 0x0e, 0x00, 0x7f, 0x80, 0x00, 0xff, 0x00, 0x70, 0x00, 0x00, 0x0e, 0x00, 0xff, 0x00, 
	0x00, 0xff, 0x80, 0x70, 0x00, 0x00, 0x0e, 0x01, 0xff, 0x00, 0x00, 0x7f, 0xc0, 0x00, 0x01, 0x80, 
	0x00, 0x03, 0xfe, 0x00, 0x00, 0x3f, 0xe0, 0x00, 0x03, 0xc0, 0x00, 0x07, 0xfc, 0x00, 0x00, 0x1f, 
	0xf0, 0x00, 0x03, 0xc0, 0x00, 0x0f, 0xf8, 0x00, 0x00, 0x0f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 
	0xf0, 0x00, 0x00, 0x07, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xe0, 0x00, 0x00, 0x03, 0xff, 0x80, 
	0x00, 0x00, 0x01, 0xff, 0xc0, 0x00, 0x00, 0x01, 0xff, 0xf0, 0x00, 0x00, 0x07, 0xff, 0x80, 0x00, 
	0x00, 0x00, 0x7f, 0xfc, 0x00, 0x00, 0x3f, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xe0, 0x07, 
	0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 
	0x03, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 
	0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00
};

const unsigned char Arduino [] PROGMEM = {
	// 'Arduino, 100x72px
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xf8, 0x00, 0x00, 0x0f, 0xff, 0xf8, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 
	0x00, 0x00, 0x0f, 0xff, 0xf8, 0x7c, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x0f, 
	0xff, 0xf8, 0xfd, 0x24, 0x01, 0x25, 0xc0, 0x24, 0x90, 0x0c, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xfd, 
	0x20, 0x00, 0x25, 0xc0, 0x04, 0x80, 0x0c, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x01, 
	0xe0, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xfc, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 
	0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x0e, 0xff, 0xe0, 
	0x87, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x0c, 0x7f, 0xf1, 0x87, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xfc, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xc1, 0xff, 0x1f, 0xc7, 0xff, 0xff, 0xfc, 0x00, 
	0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x07, 0x01, 0xff, 0xff, 0xfc, 0x00, 0x1f, 0xff, 0xff, 
	0xfd, 0x5f, 0xc3, 0xfc, 0xf2, 0x39, 0xff, 0xff, 0xfc, 0x00, 0x1f, 0xff, 0xff, 0xf0, 0x07, 0xc3, 
	0xfd, 0xf8, 0xfc, 0xff, 0xff, 0xfc, 0x00, 0x1f, 0xff, 0xff, 0xf0, 0x03, 0xff, 0xf9, 0x9c, 0xc4, 
	0xff, 0xff, 0xfc, 0x00, 0x1f, 0xff, 0xff, 0xe0, 0x03, 0xc1, 0xf9, 0xf8, 0xec, 0xff, 0xff, 0xff, 
	0x00, 0x1f, 0xff, 0xff, 0xf0, 0x03, 0xff, 0xfc, 0xf0, 0x7c, 0xff, 0xff, 0xff, 0x80, 0x1f, 0xff, 
	0xff, 0xe0, 0x03, 0xc3, 0xfc, 0x43, 0x11, 0xff, 0xff, 0xff, 0x80, 0x1f, 0xff, 0xff, 0xf0, 0x03, 
	0xc3, 0xfe, 0x0f, 0x83, 0xf0, 0xc3, 0xfb, 0x80, 0x1f, 0xff, 0xff, 0xe0, 0x03, 0xff, 0xff, 0xff, 
	0xff, 0xf0, 0xc3, 0xf9, 0x80, 0x1f, 0xff, 0xff, 0xf0, 0x03, 0xc1, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xf9, 0x80, 0x1f, 0xff, 0xff, 0xf0, 0x07, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x1f, 
	0xff, 0xff, 0xfd, 0x5f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x1f, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x08, 0x3f, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x0c, 0x7f, 0xf0, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0x81, 0x80, 0x00, 0x0f, 0xff, 0xe0, 0x39, 0xc1, 0xff, 0xff, 0xff, 0xff, 0xff, 0x85, 0x80, 
	0x00, 0x0f, 0xff, 0xc0, 0x39, 0xff, 0xf8, 0x3d, 0xb6, 0xe4, 0x27, 0x83, 0x80, 0x00, 0x0f, 0xff, 
	0xe0, 0x79, 0xc3, 0xfc, 0x3f, 0xff, 0xe0, 0x07, 0x81, 0x80, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xc3, 
	0xff, 0xff, 0xff, 0xfb, 0xcf, 0xa5, 0x80, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0xff, 
	0xfb, 0xcf, 0x81, 0x80, 0x00, 0x0f, 0xff, 0xf3, 0x1f, 0xc1, 0xf8, 0x00, 0x7f, 0xfb, 0xcf, 0x81, 
	0x80, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x7f, 0xf1, 0x8f, 0xa5, 0x80, 0x00, 0x0f, 
	0xff, 0xff, 0xff, 0xc3, 0xf8, 0x00, 0x7f, 0xe4, 0x27, 0x81, 0x80, 0x00, 0x0f, 0xff, 0xff, 0xff, 
	0xc3, 0xf8, 0x00, 0xe0, 0xec, 0x37, 0xff, 0x80, 0x00, 0x0f, 0xff, 0xfc, 0x03, 0xff, 0xff, 0xff, 
	0xf0, 0xff, 0xff, 0xff, 0x80, 0x00, 0x0f, 0xff, 0xfc, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0x80, 0x00, 0x0f, 0xff, 0xf8, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 
	0x0f, 0x00, 0xfc, 0x03, 0xff, 0x5a, 0xad, 0x5a, 0xad, 0x5a, 0xff, 0x80, 0x00, 0x0e, 0x00, 0x18, 
	0x01, 0xff, 0x52, 0xa1, 0x42, 0xa1, 0x42, 0xff, 0x80, 0x00, 0x0c, 0x00, 0x1c, 0x03, 0xfe, 0x00, 
	0x00, 0x00, 0x00, 0x00, 0x7f, 0x80, 0x00, 0x0c, 0x00, 0x78, 0x01, 0xfe, 0x00, 0x00, 0x00, 0x00, 
	0x00, 0x7f, 0x80, 0x00, 0x0c, 0x00, 0x1c, 0x03, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x80, 
	0x00, 0x0c, 0x00, 0x1f, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x80, 0x00, 0x0c, 0x00, 
	0x7f, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x80, 0x00, 0x0c, 0x00, 0x1f, 0xff, 0xfe, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x80, 0x00, 0x0f, 0x00, 0x1f, 0xff, 0xfe, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x7f, 0x80, 0x00, 0x0f, 0xff, 0xf8, 0x07, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 
	0x80, 0x00, 0x0f, 0xff, 0xf8, 0x07, 0xff, 0x52, 0xa5, 0x52, 0xa5, 0x42, 0xff, 0x80, 0x00, 0xff, 
	0xff, 0xb8, 0x07, 0xff, 0x5e, 0xbf, 0x7e, 0xbd, 0x7e, 0xff, 0x80, 0x00, 0xff, 0xff, 0xfc, 0x07, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0xff, 0xff, 0x8f, 0x07, 0xc1, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0x80, 0x00, 0xff, 0xff, 0x8e, 0x03, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x80, 0x00, 
	0xff, 0xff, 0x8c, 0x03, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x80, 0x00, 0xff, 0xff, 0x8c, 
	0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x80, 0x00, 0xff, 0xff, 0xfc, 0x01, 0x00, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xfd, 0x80, 0x00, 0xff, 0xff, 0xfc, 0x03, 0x00, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0x80, 0x00, 0xff, 0xff, 0xfe, 0x03, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 
	0x00, 0xff, 0xff, 0xff, 0x07, 0x81, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x7f, 0xf0, 
	0x7f, 0xff, 0xff, 0xe0, 0x00, 0x07, 0x80, 0x00, 0x0e, 0x00, 0x00, 0x0f, 0xf0, 0xff, 0xff, 0xff, 
	0xe9, 0x24, 0x97, 0xa4, 0x92, 0x2c, 0x00, 0x00, 0x0f, 0xfd, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x07, 
	0x80, 0x00, 0x0c, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

const unsigned char Laptop [] PROGMEM = {
	// 'Laptop, 85x85px
	0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x3f, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xf8, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x3f, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xf8, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x3f, 
	0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, 
	0x00, 0x07, 0xf8, 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf8, 0x00, 0x00, 
	0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf8, 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x07, 0xf8, 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf8, 0x00, 
	0x00, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf8, 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x07, 0xf8, 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf8, 
	0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf8, 0x00, 0x00, 0x3f, 0x80, 0x00, 
	0x00, 0x00, 0x00, 0x00, 0x07, 0xf8, 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 
	0xf8, 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf8, 0x00, 0x00, 0x3f, 0x80, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf8, 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 
	0x07, 0xf8, 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf8, 0x00, 0x00, 0x3f, 
	0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf8, 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, 
	0x00, 0x07, 0xf8, 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf8, 0x00, 0x00, 
	0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf8, 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x07, 0xf8, 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf8, 0x00, 
	0x00, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf8, 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x07, 0xf8, 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf8, 
	0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf8, 0x00, 0x00, 0x3f, 0x80, 0x00, 
	0x00, 0x00, 0x00, 0x00, 0x07, 0xf8, 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 
	0xf8, 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf8, 0x00, 0x00, 0x3f, 0x80, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf8, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xf8, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x3f, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xf8, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 
	0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 
	0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x37, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb8, 
	0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x60, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
	0x60, 0x00, 0x00, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x60, 0x00, 0x01, 0x8c, 0xf9, 
	0xe7, 0x8f, 0x3c, 0xf9, 0xe3, 0xce, 0xc0, 0x00, 0x01, 0x98, 0xf1, 0xc3, 0x0e, 0x38, 0x71, 0xe3, 
	0x8c, 0xc0, 0x00, 0x03, 0x18, 0xe3, 0xc7, 0x1e, 0x38, 0xe1, 0xc3, 0x0d, 0x80, 0x00, 0x03, 0x3f, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0x80, 0x00, 0x06, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xfb, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0c, 
	0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x06, 0x00, 0x00, 0x0c, 0x1f, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0x06, 0x00, 0x00, 0x18, 0x18, 0xe1, 0xc7, 0x1c, 0x38, 0xe1, 0xc6, 0x0c, 0x00, 0x00, 
	0x18, 0x10, 0xe3, 0x86, 0x1c, 0x78, 0xe3, 0x86, 0x0c, 0x00, 0x00, 0x30, 0x31, 0xe3, 0x8f, 0x3c, 
	0x79, 0xe3, 0x8c, 0x18, 0x00, 0x00, 0x30, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x18, 0x00, 
	0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0xe7, 0xf3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x60, 
	0x00, 0x00, 0xc6, 0x36, 0x00, 0x00, 0x00, 0x01, 0xe3, 0xc6, 0x60, 0x00, 0x00, 0xcc, 0x36, 0x00, 
	0x00, 0x00, 0x01, 0xe3, 0x8c, 0xc0, 0x00, 0x01, 0x8c, 0x6c, 0x00, 0x00, 0x00, 0x01, 0xc3, 0x8c, 
	0xc0, 0x00, 0x01, 0x8f, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0x80, 0x00, 0x03, 0x0f, 0xcf, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0x80, 0x00, 0x03, 0x00, 0x00, 0x03, 0xff, 0xff, 0x80, 0x00, 
	0x03, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x01, 0x80, 0x00, 0x03, 0x00, 0x00, 0x06, 0x00, 
	0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x0c, 0x00, 0x03, 0x00, 
	0x00, 0x06, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x0c, 0x00, 0x02, 0x00, 0x00, 0x06, 0x00, 0x00, 0x18, 
	0x00, 0x00, 0x08, 0x00, 0x06, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x04, 
	0x00, 0x00, 0x0c, 0x00, 0x00, 0x30, 0x00, 0x00, 0x18, 0x00, 0x0c, 0x00, 0x00, 0x18, 0x00, 0x00, 
	0x30, 0x00, 0x00, 0x3f, 0xff, 0xfc, 0x00, 0x00, 0x18, 0x00, 0x00, 0x60, 0x00, 0x00, 0x1f, 0xff, 
	0xf8, 0x00, 0x00, 0x30, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 
	0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00
};

const unsigned char Kalender [] PROGMEM = {
	// 'Kalender, 76x90px
	0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x7f, 0xff, 0xff, 0xff, 0xf9, 0xff, 
	0xff, 0xff, 0xff, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 
	0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 
	0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x1f, 
	0xc0, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x80, 0x30, 0xc0, 0x3f, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x7f, 
	0xc0, 0x30, 0xc0, 0x3f, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xc0, 0x30, 0xc0, 0x3f, 0xe0, 0x00, 
	0x00, 0x00, 0x00, 0x7f, 0xc0, 0x30, 0xc0, 0x3f, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xc0, 0x30, 
	0xc0, 0x3f, 0xe0, 0x07, 0xff, 0xfe, 0x00, 0x7f, 0xc0, 0x30, 0xc0, 0x3f, 0xe0, 0x07, 0xff, 0xfe, 
	0x00, 0x7f, 0xc0, 0x30, 0xc0, 0x3f, 0xe0, 0x07, 0xff, 0xfe, 0x00, 0x7f, 0xc0, 0x30, 0xc0, 0x1f, 
	0xc0, 0x07, 0xff, 0xfe, 0x00, 0x3f, 0x80, 0x30, 0xc0, 0x00, 0x00, 0x07, 0xff, 0xfe, 0x00, 0x00, 
	0x00, 0x30, 0xc0, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x0f, 
	0x80, 0x00, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x30, 
	0xc0, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x0f, 0x80, 0x00, 
	0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 
	0x00, 0x0f, 0x87, 0x00, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x0f, 0xff, 0xe0, 0x00, 0x00, 
	0x00, 0x30, 0xc0, 0x00, 0x00, 0x1f, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x1f, 
	0xff, 0xfc, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x1f, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x30, 
	0xc0, 0x00, 0x00, 0x1f, 0xe3, 0xfe, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x1f, 0x80, 0xff, 
	0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x0f, 0x80, 0x7f, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 
	0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 
	0x00, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x00, 
	0x00, 0x3f, 0x80, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x30, 
	0xc0, 0x00, 0x00, 0x1f, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x3f, 0x00, 0x3f, 
	0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x3f, 0x80, 0x7f, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 
	0x00, 0x3f, 0x80, 0x7e, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x1f, 0xc1, 0xfe, 0x00, 0x00, 
	0x00, 0x30, 0xc0, 0x00, 0x00, 0x1f, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x0f, 
	0xff, 0xfc, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x07, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x30, 
	0xc0, 0x00, 0x00, 0x01, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x7f, 0x00, 
	0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
	0x00, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 
	0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
	0x00, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 
	0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
	0x00, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xe0, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 
	0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xc0
};

void setup()
{
  // Schriften von u8g2 tft zuordnen
  u8g2Schriften.begin(tft); 

  // Zufallsgenerator starten
  randomSeed(analogRead(A0));
  Serial.begin(9600);
  delay(500);
  Serial.println("Bildschirm: " + String(tft.height()) + " x " + String(tft.width()));

  // TFT starten
  tft.begin();

  // Rotation anpassen
  tft.setRotation(2);

  // schwarzer Hintergrund
  tft.fillScreen(SCHWARZ);

  // interne Textdarstellung
  tft.setTextSize(1);
  tft.setCursor(1, 5);
  tft.setTextColor(BLAU);
  tft.print("Text");
  delay(500);

  tft.setTextSize(3);
  tft.setCursor(1, 40);
  tft.setTextColor(GRUEN);
  tft.print("Text");
  delay(500);

  tft.setTextSize(5);
  tft.setCursor(1, 70);
  tft.setTextColor(ROT);
  tft.print("Text");
  delay(500);

  tft.setTextSize(7);
  tft.setCursor(1, 120);
  tft.setTextColor(GELB);
  tft.print("Text");
  delay(500);

  tft.setTextSize(9);
  tft.setCursor(1, 200);
  tft.setTextColor(GRAU);
  tft.print("Text");
  delay(2000);

  // Textdarstellung mit u8g2
  tft.fillScreen(SCHWARZ);
  u8g2Schriften.setForegroundColor(BLAU);   
  u8g2Schriften.setBackgroundColor(SCHWARZ);
  u8g2Schriften.setCursor(1, 30);
  u8g2Schriften.setFont(u8g2_font_helvB24_tf);   
  u8g2Schriften.print("Text");
  delay(500);

  u8g2Schriften.setForegroundColor(GRUEN);   
  u8g2Schriften.setCursor(1, 70);
  u8g2Schriften.setFont(u8g2_font_fub30_tf);   
  u8g2Schriften.print("Text");
  delay(500);

  u8g2Schriften.setForegroundColor(CYAN);   
  u8g2Schriften.setCursor(1, 120);
  u8g2Schriften.setFont(u8g2_font_inb38_mf);   
  u8g2Schriften.print("Text");
  delay(500);

  u8g2Schriften.setForegroundColor(PINK);   
  u8g2Schriften.setCursor(1, 190);
  u8g2Schriften.setFont(u8g2_font_fub42_tr);   
  u8g2Schriften.print("Text");

  delay(500);
  u8g2Schriften.setForegroundColor(BLAU);   
  u8g2Schriften.setCursor(1, 280);
  u8g2Schriften.setFont(u8g2_font_logisoso58_tf);   
  u8g2Schriften.print("Text");
  delay(2000);

  // zufällige Pixel
  tft.fillScreen(SCHWARZ);
  for  (int i = 0; i < 700; i++)
  {
    int PixelX = random(1, tft.width());
    int PixelY = random(1, tft.height());
    tft.drawPixel(PixelX, PixelY, tft.color565(random(255),random(255),random(255)));
    delay(5);
  }
  delay(2000);

  // Linien ziehen
  tft.fillScreen(SCHWARZ);
  for (int i = 1; i < tft.height(); i+=10)
  {
    tft.drawLine(1, i, tft.width(), i, ORANGE);
  }
  delay(2000);

  // Kreise vom Mittelpunkt zeichnen
  tft.fillScreen(SCHWARZ);
  for (int i = 1; i < tft.width() / 2; i+=10)
  {
    tft.fillCircle(tft.width() / 2, tft.height() / 2, tft.width() / 2 - i, tft.color565(random(255),random(255),random(255)));
    delay(50);
  }
  delay(2000);

  // Rechtecke zeichnen
  tft.fillScreen(SCHWARZ);
  for (int i = 1; i < tft.width(); i+=10)
  {
    tft.drawRect(tft.width() / 2 - i / 2, tft.height() / 2 - i / 2 , i, i, tft.color565(random(255),random(255),random(255)));
  }
  delay(2000);

   // ausgefüllte Rechtecke zeichnen
  tft.fillScreen(SCHWARZ);
  for (int i = 1; i < tft.width() / 2; i+=10)
  {
    tft.fillRect(i, i, i, i, tft.color565(random(ROT),random(GRUEN),random(BLAU)));
    delay(50);
  }
  delay(2000);

  // Dreiecke
  tft.fillScreen(SCHWARZ);
  for (int i = 1; i <tft.width(); i+=10)
  {
    tft.fillTriangle(i, i, 100, 100, 1, tft.width(), tft.color565(random(255),random(255),random(255)));
    delay(50);
  }
  delay(2000);

  // Bitmaps anzeigen
  tft.fillScreen(SCHWARZ);
  tft.drawBitmap(20, 1, Uhr, 80, 80, WEISS);
  tft.drawBitmap(150, 1, Kalender, 75, 90, WEISS);  
  tft.drawBitmap(5, 150, Arduino, 100, 72, WEISS);  
  tft.drawBitmap(140, 150, Laptop, 85, 85, WEISS);      
}

void loop()
{
  // nichts zu tun, das Programm
  // läuft nur einmal
}

GFX­can­vas - Fla­ckern des TFTs vermeiden

Soll ein schnell wech­seln­der Text an der glei­chen Posi­ti­on dar­ge­stellt wer­den, gibt es zwei Probleme:

  • der geän­der­te Text ist län­ger oder kür­zer als der vor­he­ri­ge, dadurch über­lap­pen sich die Buchstaben
  • der neue Text ver­ur­sacht ein Fla­ckern des TFTs

Das ers­te Pro­blem lässt sich lösen indem der bis­he­ri­ge Text durch ein aus­ge­füll­tes Recht­eck "gelöscht" wird. Das ver­hin­dert aller­dings nicht das Fla­ckern des TFTs.

Das Fla­ckern lässt sich durch Can­vas besei­ti­gen. Hier­bei wird ein Bild der dar­zu­stel­len­den Daten im Spei­cher ange­legt, auf Anfor­de­rung wird die­ses Bild auf dem TFT dargestellt.

Im Film wird der blau dar­ge­stell­te Bereich mit GFX­can­vas erzeugt, im roten Bereich wird der Text zunächst durch ein rotes Recht­eck "gelöscht" und anschlie­ßend neu geschrie­ben. Als Text wird die mit ⇒mil­lis() gemes­se­ne Zeit, die seit dem Start des Pro­gramms ver­gan­gen ist, dar­ge­stellt.
Man kann den Unter­schied gut erkennen.

Jedes Objekt vom Typ GFXcanvas1 benö­tigt pro ein Bit pro Pixel. Wie im Bei­spiel eines Bereichs mit 240×150 Pixeln sind das 36.000 Bits, das ent­spricht 4.500 Bytes oder 4,5 kilo­Bytes. Der Spei­cher­platz eines Ardui­no UNO R3 reicht hier­für nicht aus.

// Display mit 320x240 Pixeln
#include "Adafruit_ILI9341.h"

// Wemos D1 Mini
// #define TFT_CS       D8
// #define TFT_RST      D1
// #define TFT_DC       D2

// XIAO
// #define TFT_CS       D7
// #define TFT_RST      D1
// #define TFT_DC       D2

// Arduino Nano ESP 32
// #define TFT_CS       10
// #define TFT_RST       9
// #define TFT_DC        8


// ESP32-C6
// #define TFT_CS       18
// #define TFT_RST       3                                          
// #define TFT_DC        2

// ESP32-WROOM
// #define TFT_CS        5
// #define TFT_RST       4 
// #define TFT_DC        2


Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);

// 1-Bit Canvas definieren
GFXcanvas1 Bereich(240, 150);

void setup() 
{
  // TFT starten
  tft.begin();

  // wenn die Farben invertiert sind
  // weiß = schwarz, schwarz = weiss ...
  // // entfernen
  // tft.invertDisplay(1); 

  // schwarzer Hintergrund
  tft.fillScreen(0x0000);
  
  // Text darf nicht über den Rand fließen
  Bereich.setTextWrap(false);
  tft.setTextWrap(false);

}

void loop() 
{
  // Canvas erstellen
  Bereich.fillScreen(0x0000);    
  Bereich.setCursor(1, 40); 
  Bereich.setTextSize(3);  
  Bereich.print("Millisekunden:");
  Bereich.setCursor(1, 80); 
  Bereich.print(millis());  

  // Canvas als Bild anzeigen
  /* 
    Farben
    0x0000 = schwarz
    0xFFFF = weiß
    0x000F = blau
    0xF800 = rot
  */
  tft.drawBitmap(0, 0, Bereich.getBuffer(), Bereich.width(), Bereich.height(), 0xFFFF, 0x000F);

  // Bereich für den Text "löschen"
  tft.fillRect(1, 180, tft.width(), 100, 0xF800);
  tft.setCursor(1, 200);
  tft.setTextSize(3);
  tft.print("Millisekunden:");
  tft.setCursor(1, 240);

  tft.println(millis());
}

Quel­len


Letzte Aktualisierung: März 24, 2025 @ 9:31