Please help me how to display on tft Serial.read()
My equipment : Arduino UNO + ARDUINO RIVERDI TFT SHIELD + RVT43ULFNWC01 - LCD-TFT Riverdi (4.3-calowy, 480x272, FT801)
Unfortunately, my attempts failed
#include "SPI.h"
#include "Wire.h"
#include "FT_VM801B43.h"
FT801IMPL_SPI FTImpl(FT_CS_PIN,FT_PDN_PIN,FT_INT_PIN);
String inputString = ""; // a String to hold incoming data
bool stringComplete = false; // whether the string is complete
int16_t BootupConfigure()
{
uint32_t chipid = 0;
FTImpl.Init(FT_DISPLAY_RESOLUTION);//configure the display to the WQVGA
delay(20);//for safer side
chipid = FTImpl.Read32(FT_ROM_CHIPID);
/* Identify the chip */
if(FT801_CHIPID != chipid)
{
Serial.print("Error in chip id read ");
Serial.println(chipid,HEX);
return 1;
}
/* Set the Display & audio pins */
FTImpl.SetDisplayEnablePin(FT_DISPENABLE_PIN);
FTImpl.SetAudioEnablePin(FT_AUDIOENABLE_PIN);
FTImpl.DisplayOn();
FTImpl.AudioOn();
return 0;
}
void setup() {
BootupConfigure();
// initialize serial:
Serial.begin(9600);
// reserve 200 bytes for the inputString:
inputString.reserve(200);
}
void loop() {
// print the string when a newline arrives:
if (stringComplete) {
Serial.println(inputString);
// clear the string:
inputString = "";
stringComplete = false;
}
serialEvent();
}
/*
SerialEvent occurs whenever a new data comes in the hardware serial RX. This
routine is run between each time loop() runs, so using delay inside loop can
delay response. Multiple bytes of data may be available.
*/
//**********************************************************
void serialEvent() {
while (Serial.available()) {
// get the new byte:
char inChar = Serial.read();
// add it to the inputString:
inputString += inChar;
// if the incoming character is a newline, set a flag so the main loop can
// do something about it:
if (inChar == '\n') {
stringComplete = true;
//const char Display_string[12] = "Test";
FTImpl.DLStart();
FTImpl.ColorRGB(0xFF,0xFF,0xFF);
FTImpl.Cmd_Text(FT_DISPLAYWIDTH/2, FT_DISPLAYHEIGHT/2, 29, FT_OPT_CENTER, inChar);
//FTImpl.Cmd_Text(FT_DISPLAYWIDTH/2, FT_DISPLAYHEIGHT/2, 29, FT_OPT_CENTER, Display_string);
FTImpl.DLEnd();
FTImpl.Finish();
//**********************************************************
}
}
}
I am asking for any example or help.