ecaits
Member level 4
Hi,
I want to interface 2.8" TFT which is of mcufriend, images attached for reference, with arduino uno.
I have written code as per below given but it display on white screen.
I have used SPI interfacing. Is there any library missing or anything else is the issue?
I want to interface 2.8" TFT which is of mcufriend, images attached for reference, with arduino uno.
I have written code as per below given but it display on white screen.
I have used SPI interfacing. Is there any library missing or anything else is the issue?
Code:
#include <TFT.h>
#include <SPI.h>
#define cs A3
#define dc A2
#define rst A4
TFT TFTscreen = TFT(cs, dc, rst);
char sensorPrintout[4];
void setup() {
TFTscreen.begin();
TFTscreen.background(0, 0, 0);
TFTscreen.stroke(255, 255, 255);
TFTscreen.setTextSize(2);
TFTscreen.text("Sensor Value :\n ", 0, 0);
TFTscreen.setTextSize(5);
}
void loop() {
String sensorVal = String(analogRead(A0));
sensorVal.toCharArray(sensorPrintout, 4);
TFTscreen.stroke(255, 255, 255);
TFTscreen.text(sensorPrintout, 0, 20);
delay(250);
TFTscreen.stroke(0, 0, 0);
TFTscreen.text(sensorPrintout, 0, 20);
}
Last edited by a moderator: