The RA8875 5" with GSL1680 controller is quite simple, build many projects with this RA8875 display.
Best regards,
Johan
Code:
#include <SPI.h>
#include <RA8875.h>
#include <GSL1680.h>
#define TC_INT 8
// install : ILI9341_fonts-master
#include "font_LiberationMono.h"
#include "font_DroidSansMono.h"
#include "font_AwesomeF000.h"
#include "font_AwesomeF200.h"
#include "font_AwesomeF180.h"
#include "font_AwesomeF100.h"
#include "font_AwesomeF080.h"
uint16_t buttons_time =100;
#define WAKE 255
GSL1680 TS = GSL1680();
uint16_t TouchY;
uint16_t TouchX;
bool TouchZ = false;
#define RA8875_RESET 255 //Not used
#define RA8875_CS 10
RA8875 tft = RA8875(RA8875_CS, RA8875_RESET, 11, 13, 12); // 11=MOSI 13=SCLK 12=MISO 10=CS
void setup() {
tft.begin(RA8875_800x480);
tft.setRotation(0);
tft.setCursor(200,350);
tft.setFont(DroidSansMono_16);
tft.print("Touch test wait for I2C bus");
delay(3500); // time for I2C bus
TS.begin(-1, TC_INT);
tft.clearScreen();
}
void loop() {
tft.setCursor(200,250);
tft.print(TouchX);
tft.setCursor(200,350);
tft.print(TouchY);
if (digitalRead(TC_INT) == HIGH) {
int NBFinger = TS.dataread();
for (int i = 0; i < NBFinger; i++) {
TouchX = (TS.readFingerX(i));
TouchY = (TS.readFingerY(i));
}
}
TouchZ = TS.dataread();
}