How do i get the code to display at the same time of 2 screens

edited November 2015 in Arduino

I have 2 1.4TFT screens wired up to an Arduino board and only one is displaying the graphic. How do i get it to display both at the same time?

Arduino code

#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library
#include <SPI.h>

#define TFT_CS   (4, 10)
#define TFT_RST  (3, 9)              
#define TFT_DC   (2, 8)
#define TFT_SCLK (7, 13)
#define TFT_MOSI (5, 11)

Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);

void setup(void) { 
  tft.initR(INITR_144GREENTAB);   // initialize a ST7735S chip, black tab
  testdrawrects(ST7735_WHITE);
}

void loop() {
  tft.invertDisplay(false);
}

void testdrawrects(uint16_t color) {
  tft.fillScreen(ST7735_BLACK);
  for (int16_t x=0; x < tft.width(); x+=6) {
    tft.drawRect(tft.width()/2 -x/2, tft.height()/2 -x/2 , x, x, color);
  }
}

Answers

Sign In or Register to comment.