Go Down

Topic: dual displays (Read 1 time) previous topic - next topic


Hi ; I would like to put another st7735 tft (spi) on my project...

I figure if it's spi, miso and mosi would be the same pin, cs evidently would not, but don't know about the others...

That is if the library supports it / if it's possible to instantiate 2 tft...

Any info on that would be appreciated


You can put as many devices on the SPI bus as you like.

I think someone showed an example of multiple ST7735 or ILI9163 displays.
I would be wary of bit-bashed SPI but the hardware SPI should be fine.



Thanks David  :)

Continued googling around to find out more... posted an "issue" on https://github.com/adafruit/Adafruit-ST7735-Library/issues/30 (it's really more of a question as I love what they have done)...

Maybe using 2 different sceens (with 2 different libraries) could be a way...



this site has some good info about dual displays ; will take a closer look at it...

spicifically, I want to display battery info and power usage on a e-bike...


Feb 29, 2016, 02:19 pm Last Edit: Feb 29, 2016, 02:26 pm by altermontrealiste
from https://learn.adafruit.com/animated-electronic-eyes-using-teensy-3-1?view=all

Gnd to GND
TCS to Digital Pin 9 (left TFT) or 10 (right TFT)
RST to Digital Pin 8
D/C to Digital Pin 7

that settles the hardware / wiring part ; only CS has to be different :)


When did anyone suggest otherwise?

You can put as many devices on the SPI bus as you like.   Only one device can be active at any one time.   e.g. only one CS is active.

Provide proper 3.3V logic levels and everything will work fine.



Feb 29, 2016, 10:20 pm Last Edit: Feb 29, 2016, 10:20 pm by TFTLCDCyg

1 Define one instance for each TFT

2 Separate wiring for each CS-pin

For example:
Board: teensy 3.2 or arduino Due

Code: [Select]
#include <SPI.h>
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"

#define TFT_DC 9
#define TFT_CS 10
#define TFT_CS2 21

Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
Adafruit_ILI9341 tft2 = Adafruit_ILI9341(TFT_CS2, TFT_DC);

Video: Two ILI9341 on teensy 3.2



Jan 27, 2020, 07:53 pm Last Edit: Jan 27, 2020, 08:12 pm by jxid
Looking for answer to my question i found this thread.
So i ask you:
I want to use 2 ST7735 displays with an arduino Nano.
I want to print different data to each display at the same time.
So far i have manage to have same data on 2 displays.
I read that i have to define different CS pin for each display and all other pins mus be the same.
So here is my code.

Code: [Select]
#include <TFT_ST7735.h>
#include <SPI.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
#include "RTClib.h"
#include <Wire.h>
#include <Adafruit_GFX.h>

#define TFT_CS1 6
#define TFT_DC  8
#define TFT_CS  9

#define ST7735_TFTWIDTH  128
#define ST7735_TFTHEIGHT 128

#define TFT_BLACK 0x0000
#define TFT_RED 0x001F
#define TFT_GREEN 0x07E0
#define TFT_WHITE 0xFFFF
#define TFT_BLUE 0xF800
#define TFT_YELLOW 0x07FF
#define TFT_CYAN 0xFFE0
#define TFT_MAGENTA 0xF81F

TFT_ST7735 tft = TFT_ST7735(TFT_CS,TFT_DC);
TFT_ST7735 tft1 = TFT_ST7735(TFT_CS1,TFT_DC);  
Adafruit_BME280 bme;
RTC_DS3231 rtc;

char daysOfTheWeek[7][12] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
char dtBuffer[12];
char Day[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
const char * months[12] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};

void setup()
  //rtc.adjust(DateTime(F(__DATE__),F(__TIME__))); //Set Date and Time from PC
  //rtc.adjust(DateTime(2019, 10, 27, 23, 21, 40));  //Set Date and Time Manually

void loop()
//Print Temperature  
  tft.setTextColor(TFT_RED, TFT_BLACK);
  tft.drawString("*C", 75,22,2);  // print degree symbol and C
//Print Humidity
  tft.setTextColor(TFT_GREEN, TFT_BLACK);
//Print Pressure
  tft.setTextColor(TFT_YELLOW, TFT_BLACK);
  tft.print((bme.readPressure() / 100) , 1);  
  tft.drawString(" hPa",91,105,2);

//Time from RTC
  DateTime now = rtc.now();
  sprintf(dtBuffer,"%02u : %02u : %02u ",now.hour(),now.minute(),now.second());  
//Date from RTC
  sprintf(dtBuffer,"%02u/%02u/%02u ",now.day(),now.month(),now.year());  
//Day Of Week from RTC

I have declared tft as first display and tft1 as the second.
Can anyone help me?Thank you.


My problem solved.
I found the solution in a post from bodmer.
For any one that may interesting


Go Up