I am trying to connect two ST7735 tft displays to one arduino Nano.
Using the hardware SPI pins I am able to get some information on one or the other tft display.
The CS pin for both displays are on a different nano pin.
It looks like the second init of the tft overwrites the first one.
Following is a test sketch I am using.
#include <SPI.h>
#include <Adafruit_ST7735.h>
#define cs1 10
#define cs2 9
#define dc 8
#define rst 7
Adafruit_ST7735 tft1 = Adafruit_ST7735( cs1, dc, rst); // declare an instance of the ST7735
Adafruit_ST7735 tft2 = Adafruit_ST7735( cs2, dc, rst); // declare an instance of the ST7735
void setup() {
SPI.begin();
tft1.initR(INITR_BLACKTAB);
tft2.initR(INITR_BLACKTAB);
tft1.setRotation( 1);
tft1.fillScreen(ST7735_BLUE);
tft2.setRotation( 1);
tft2.fillScreen(ST7735_RED);
}
void loop(){
tft1.setTextColor( ST7735_WHITE);
tft1.print(millis());
tft2.print(millis());
delay(200);
}
What am I missing? I have seen examples with two different displays, found the haloween eyes sketch but is not suitable for my setup.
Can anyone help me to shed some light on this issue?
Thanks in advance.