Sunday, 8 March 2020

1.8TFT 128 x 160 Display Pin Outs

There are sixteen pins on this device.  All are labeled on the rear of the display module and are also shown in the image below.  Those pins that are highlighted blue are those that you will be interested in when connecting as a display for your Arduino.

You will notice that some of the pins share the same name.  Those redundant pins are for the SD card on the rear.












1.8TFT V1.0 ST7735 Arduino Tutorial
Download and Install Libraries
You will require two libraries to make use of this display.  If you are unfamiliar with how to add libraries to your Arduino IDE,  I recommend reading this article.

The first is the Adafruit_GFX library.   This is library has some time saving functions, that in addition to allowing you to print text, make it easy to create things like boxes, lines and circles.  You can get the Adafruit GFX library HERE.

You will also need a library for the ST7735 TFT Controller.   You can get a copy of the Adafruit ST7735 library HERE.


Connect to Arduino
Even though it may not make sense, you will want to connect your ground and 3.3V power exactly as shown.  Connecting to VCC and ground like you’re accustomed to doing just won’t work here.

You could just run the Adafruit ST7735 graphicstest example.  In fact I recommend that you do after running the sketch below.

I recommend you try the sketch below first because it makes the basic requirements clearer.


#include     
#include  
#include


#define TFT_CS     10
#define TFT_RST    9
#define TFT_DC     8

#define TFT_SCLK 13 
#define TFT_MOSI 11 

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

void setup(void) {
  tft.initR(INITR_BLACKTAB);  // You will need to do this in every sketch
  tft.fillScreen(ST7735_BLACK);


  //tft print function!
  tft.setTextColor(ST7735_WHITE);
  tft.setTextSize(0);
  tft.setCursor(30,80);
  tft.println("Hello World!");
  delay(1000);

}

void loop() {
  tft.invertDisplay(true);
  delay(500);
  tft.invertDisplay(false);
  delay(500);
}


No comments: