kk logo

Diese Seite ist eine Ergänzung zum YouTube Video https://www.youtube.com/watch?v=A7u_lcjFUjY  wo ich die Programmierung des 1,77 Zoll TFT mit Ardublock erkläre.

177 Zoll TFT Display am Arduino UNO R3 3

 Die PIN Belegung für den Arduino UNO

TFT Display Arduino
 GND  GND
 VCC  5 Volt
 SCK  digitaler Pin D13
 SDA  digitaler Pin D11
 RES  digitaler Pin D8
 RS  digitaler Pin D9
 CS  digitaler Pin D10
 LED  A  3,3 Volt

Programmieren des Displays in der Arduino IDE

Benötigte Bibliotheken

Der einfachste Weg die benötigte Bibliothek “Adafruit-ST7735” zu installieren ist über den Bibliotheksverwalter der Arduino IDE. In dem geöffneten Bibliotheksverwalter suchst du zunächst nach “adafruit st7735”. Und wählst im Eintrag “Adafruit ST7735 and ST7709 Library by Adafruit” die Schaltfläche “Installieren”. Es wird zusätzlich eine Bibliothek benötigt, welche wir ebenfalls installieren müssen und betätigen die Schaltfläche “Install all”.

177 Zoll TFT Display am Arduino UNO R3 1

 Hier der Code als COPY und PASTE für Ardublock

Code im Globalen Bereich einfügen 

#include <Adafruit_GFX.h>

#include <Adafruit_ST7735.h>

#include <SPI.h>

#define CS 10

#define RES 8

#define RS 9

#define SCK 13

#define SDA 11

Adafruit_ST7735 tft = Adafruit_ST7735(CS, RS, SDA, SCK, RES);

const uint16_t Black = 0x0000; const uint16_t Blue = 0x001F; const uint16_t Red = 0xF800; const uint16_t Green = 0x07E0; const uint16_t Cyan = 0x07FF; const uint16_t Magenta = 0xF81F; const uint16_t Yellow = 0xFFE0; const uint16_t White = 0xFFFF;

Code im setup einfügen:

tft.initR(INITR_GREENTAB);

tft.fillScreen(Backround_Color);

tft.setFont();

Code im Loop einfügen 

tft.fillRect(50, 25, 60, 50, Backround_Color);

tft.setTextColor(Text_Color);

tft.setCursor(10, 10);

tft.print("Hello World!");

tft.drawRect(0, 0, 124, 156, Blue);

tft.drawLine(65, 40, 65, 80, Blue);

by grace

By grace alone somehow I standWhere even angels fear to treadInvited by redeeming loveBefore the throne of God aboveHe pulls me close with nail-scarred handsInto His everlasting arms

Ronnie

schwäbischer tüftler und bastler, kraftsportler, 41 Jahre, 1 Frau, 5 Kinder und 1003 Ideen. 

ronnie berzins at mee