I'm new to the field: I'm trying to drive a TFT ST7735S display (this is the model I'm currently using: https://www.amazon.it/dp/B078JBBPXK/ref=pe_24968671_487022601_TE_SCE_dp_1) with an Arduino Mega following this video (https://www.youtube.com/watch?v=iPeukOK6stk&ab_channel=Artigiano2.0-AlessioRomanelli). Once the hardware is set up and the code is written, when I run the example script "graphictest" of the Adafruit library for st7735 and st7789, the display shows stripes on the background as shown in the picture below:
(Note that the strange effect is not camera's fault)
Reading online I thought that the problem could be the fact that the display is powered with 5V instead of 3.3V, but I've also tried powering it with 3.3V (Arduino Mega 3.3V) with little to no changes. I've changed the tft.initR(INITR_BLACKTAB);
to tft.initR(INITR_GREENTAB);
too, as suggested by a user i this thread (https://forum.arduino.cc/t/bugged-1-8-inch-tft-diplay/1012166/5) and i've also tried powering the display with 5V but using 4.7k resistors in series to reduce the voltage as suggested in the same post, but it still doesn't work.
Moreover the strange effect that the image shows does only appear, if I use a 5V supply, just when the program executes the void setup()
function, then becomes sharp (this does not happen if I power the display using the Arduino Mega 3.3V output supply: in fact in this case the stripes are still present even when entering the void loop()
function)
As I said before, the program and the hardware setup arethe same as the video I was talking about. One thing I noticed is that, when I press the reset button on the Arduino Mega, an instant before the program is reloaded, the stripes disappear leaving the image as sharp as it should have been, without any strange background effect. Does anyone have any idea on how to solve this issue?
Thank you in advance for any eventual answer!
EDIT:
This is the picture of the modified verison of the connections, running the graphictest program with the suggested code:
#else
// For the breakout board, you can use any 2 or 3 pins.
// These pins will also work for the 1.8" TFT shield.
#define TFT_CS 10
//#define TFT_RST 9 // Or set to -1 and connect to Arduino RESET pin
#define TFT_RST 8 // Or set to -1 and connect to Arduino RESET pin
#define TFT_DC 9
#endif
// OPTION 2 lets you interface the display using ANY TWO or THREE PINS, // tradeoff being that performance is not as fast as hardware SPI above.
#define TFT_MOSI 11 // Data out
#define TFT_SCLK 13 // Clock out
// For ST7735-based displays, we will use this call
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);
Hopefully every connection is visible