1.8“ TFT Display
Published: 08.11.2018
Copyright by Joy-IT
6
2.3 EXAMPLE-CODE
Below you can find a code example with which you can display any text on the display. Please copy the
entire code to your Arduino.
#include <TFT.h>
#include <SPI.h>
//PIN
-
Einstellungen
#define cs 10
#define dc 9
#define rst 8
TFT TFTscreen
=
TFT(cs, dc, rst);
void
setup
() {
TFTscreen.begin();
//Hintergrund: Schwarz
TFTscreen.background(
0
,
0
,
0
);
//Textfarbe: Weiß
TFTscreen.stroke(
255
,
255
,
255
);
}
void
loop
() {
//Schriftgröße einstellen
TFTscreen.setTextSize(
3
);
//Text ausgeben
TFTscreen.text(
"joy
-
IT"
,
0
,
0
);
//Schriftgröße einstellen
TFTscreen.setTextSize(
2
);
//Text ausgeben
TFTscreen.text(
"1.8 TFT LCD"
,
0
,
40
);
//Schriftgröße einstellen
TFTscreen.setTextSize(
1
);
//Text ausgeben
TFTscreen.text(
"ST7735"
,
0
,
60
);
delay(
250
);
}
Summary of Contents for RB-TFT1.8
Page 1: ...1 8 TFT Display 3...