Hello
I have a problem with developing a project using a KMR-1.8 module.
Using
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library
#include <SPI.h>
Realized the project in way 2
#define TFT_CS 8
#define TFT_RST 0
#define TFT_DC 9
#define TFT_SCLK 10
#define TFT_MOSI 7
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);
Work fine.
Realized the project in way 1
#define TFT_CS 8
#define TFT_RST 0
#define TFT_DC 9
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);
#define TFT_SCLK 13
#define TFT_MOSI 11
Does not work.
Someone has some ideas!
Thank’s
Giacomo
First off. Never use digital#0 in a constructor or even in real life. It is the Serial RXD pin.
Secondly. Always connect TFT_RST to a real GPIO pin. Most Chinese modules do not have an onboard pullup resistor. So if you can't spare a GPIO pin, use an external pullup resistor.
Yes, a software SPI constructor should always work.
If you choose the hardware pins, you can choose either form of constructor.
You can compare performance.
Connect TFT_RST to a real pin. Always use the full-fat constructor i.e. with the RST argument.
If you intend to not use RST, you use -1 for the argument.
David.
Solved: The trouble was the reset pin. Moved and cofigured for pin 10 work fine !
The original example say:
// you can also connect this to the Arduino reset in which case, set this #define pin to 0!
Thank's
The current library (Adafruit_ST7735_and_ST7789) uses -1 as don't care.
Adafruit boards have pullups on RST. So they will work without a specific connection.
Adafruit examples tend to use the shortform constructor which omits the RST argument.
This guarantees failure on most Chinese boards. Punters will buy an Adafruit board as replacement.
David.