Connections
Connections as follows:
- BLK -> 5V
- CS -> D10 (or anything, i.e. D9 - just change the
#define below)
- DC -> D9 (or anything, i.e. D8 - just change the
#define below)
- RST -> D8 (or anything, i.e. D7 - just change the
#define below)
- SDA -> D11
- SCL -> D13
- VDD -> 5V
- GND -> GND
Using TFT library
You can use the TFT library:
#include <TFT.h>
#include <SPI.h>
With the following #defines:
#define CS 10
#define DC 9
#define RST 8
Note: if you used different pins, then just change the numbers.
Create an instance and initialise with:
TFT myDisplay = TFT(CS, DC, RST);
myDisplay.begin();
Using GFX
#include <Adafruit_GFX.h>
#include <Adafruit_ST7735.h>
#include <SPI.h>
With the following #defines:
#define CS 10
#define DC 9
#define RST 8
Note: if you used different pins, then just change the numbers.
Create instance1:
Adafruit_ST7735 myDisplay = Adafruit_ST7735(CS, DC, RST);
Initialise with
myDisplay.initR(INITR_BLACKTAB);
Further reading
Footnote
1
Alternative instance creation, which is slower, but you can use different MOSI/SCLK pins (hence the additional #defines):
#define SCLK 13 // You can change this
#define MOSI 11 // You can change this
Adafruit_ST7735 myDisplay = Adafruit_ST7735(CS, DC, MOSI, SCLK, RST);