system
September 29, 2018, 3:18pm
#1
Hello,
I have a 2.8" TFT w/ SD card (and touch IC NOT installed). Markings :
2.8 TFT SPI 240*320 v1.1
TJCTM24028-SPI
I spent many hours on the try to display something, but no. It persists denying to display anything but "white" back led light.
I ead its a ILI9341 controller but I have tried many ili9341 libs, no luck. Can't say if it is in fact a 9341
Any help , recognizing controller - pointing lib etc) much appreciated
EDIT
Use with Mega2560. pins 9,10 51, 52, 53.
Level matching to 3v3 with resistors 560/1200 ohm
system
September 29, 2018, 3:31pm
#2
and this is the code i used for 9341
#include <SPI.h>
#include <Wire.h> // this is needed even tho we aren't using it
#include "Adafruit_ILI9341.h"
//#include <XPT2046_Touchscreen.h>
/*
// This is calibration data for the raw touch data to the screen coordinates
#define TS_MINX 150
#define TS_MINY 130
#define TS_MAXX 3800
#define TS_MAXY 4000
// The XPT2046 uses hardware SPI on the shield, and #8
#define CS_PIN 8
XPT2046_Touchscreen ts(CS_PIN);
*/
// The display also uses hardware SPI, plus #9 & #10
#define TFT_DC 9 //9 was 6
#define TFT_CS 10 //10 was 5
#define TFT_RST 7 //8
//#define TFT_LED 9
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
// Size of the color selection boxes and the paintbrush size
#define BOXSIZE 40
#define PENRADIUS 3
int oldcolor, currentcolor;
void setup(void) {
// while (!Serial); // used for leonardo debugging
pinMode(TFT_LED, OUTPUT);
digitalWrite(TFT_LED, HIGH);
Serial.begin(115200);
Serial.println(F("Touch Paint!"));
tft.begin();
//ts.begin();
tft.setRotation(3);
tft.fillScreen(ILI9341_BLACK);
// make the color selection boxes
tft.fillRect(0, 0, BOXSIZE, BOXSIZE, ILI9341_RED);
tft.fillRect(BOXSIZE, 0, BOXSIZE, BOXSIZE, ILI9341_YELLOW);
tft.fillRect(BOXSIZE * 2, 0, BOXSIZE, BOXSIZE, ILI9341_GREEN);
tft.fillRect(BOXSIZE * 3, 0, BOXSIZE, BOXSIZE, ILI9341_CYAN);
tft.fillRect(BOXSIZE * 4, 0, BOXSIZE, BOXSIZE, ILI9341_BLUE);
tft.fillRect(BOXSIZE * 5, 0, BOXSIZE, BOXSIZE, ILI9341_MAGENTA);
// select the current color 'red'
tft.drawRect(0, 0, BOXSIZE, BOXSIZE, ILI9341_WHITE);
currentcolor = ILI9341_RED;
}
void loop()
{
}