background image

1.8“ TFT Display

 

Published: 08.11.2018  

Copyright by Joy-IT 

 

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...

Page 2: ...no 2 1 Connecting the display 2 2 Installing the library 2 3 Example Code 3 Usage with a Raspberry Pi 3 1 Connecting the display 3 2 Installing the software 3 3 Installing the module 3 4 Displaying an...

Page 3: ...following we will show you what has to be observed during commissioning and use Should you encounter any unexpected problems during use please feel free to contact us 2 1 CONNECTING THE DISPLAY Conne...

Page 4: ...INSTALLING THE LIBRARY Before you transfer the source code in chapter 2 3 to your Arduino you must first add the TFT library As shown in Figure 2 click on Sketch Include library Manage libraries TFT P...

Page 5: ...Copyright by Joy IT 5 In the library manager that opens search for the library of the same name under the search term TFT and install it You can now select an example code under File Examples TFT and...

Page 6: ...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 einst...

Page 7: ...NNECTING THE DISPLAY Connect the display to the pins of your Raspberry Pis as shown in the following figure and table 3 USAGE WITH A RASPBERRY PI TFT PIN Raspberry Pi PIN VCC PIN 1 3 3V GND PIN 6 GND...

Page 8: ...k Imager program which you can download from the following link Once the installation is complete you can remove the SD card insert it into your Raspberry Pi and start it 3 3 INSTALLING THE MODULE Fir...

Page 9: ...lines to the file Another file must now be created Insert the following content The value rotate 90 allows in our case the rotation of the display by 90 You can choose between 0 90 180 and 270 which...

Page 10: ...during the playback of a movie it is recommended to mirror the graphic output framebuffer by the program fbcp so that it can be calculated by the graphics card unit Therefore the program has to be in...

Page 11: ...Display Published 08 11 2018 Copyright by Joy IT 11 You can now play the video with the following command The following command can be used to deactivate mirroring again omxplayer MVI_0043 avi killal...

Page 12: ...from us free of charge for disposal when you purchase a new appliance Small appliances with no external dimensions greater than 25 cm can be returned in normal household quantities independently of th...

Page 13: ...urchase If you still have questions or problems we are also available by e mail telephone and ticket support system E Mail service joy it net Ticket System http support joy it net Phone 49 0 2845 9846...

Reviews: