Error Compilling Screen tft LCD 2.8 + Sensor

I have been getting this error while compiling on my arduino mega but its working fine on my arduino Uno if someone already had the same issue with their screen.

/Users/**/Documents/Arduino/libraries/TFTLCD-Library-master/Adafruit_TFTLCD.cpp:933:0: warning: “read8” redefined
#define read8(x) x = read8fn()

In file included from /Users//Documents/Arduino/libraries/TFTLCD-Library-master/Adafruit_TFTLCD.cpp:17:0:
/Users/
/Documents/Arduino/libraries/TFTLCD-Library-master/pin_magic.h:230:0: note: this is the location of the previous definition
#define read8 read8inline

/Users//Documents//libraries/TFTLCD-Library-master/Adafruit_TFTLCD.cpp: In member function ‘void Adafruit_TFTLCD::begin(uint16_t)’:
/Users//Documents/Arduino/libraries/TFTLCD-Library-master/pin_magic.h:533:12: warning: large integer implicitly truncated to unsigned type [-Woverflow]
lo = (d);
^
/Users/
/Documents/Arduino/libraries/TFTLCD-Library-master/pin_magic.h:234:25: note: in expansion of macro ‘writeRegister16inline’
#define writeRegister16 writeRegister16inline
^~~~~~~~~~~~~~~~~~~~~
/Users/**l/Documents/Arduino/libraries/TFTLCD-Library-master/Adafruit_TFTLCD.cpp:352:5: note: in expansion of macro ‘writeRegister16’
writeRegister16(ILI9341_VCOMCONTROL1, 0x2B2B);

Code

#include “Adafruit_TFTLCD.h”
#include “Adafruit_GFX.h”
#include “TouchScreen.h”

#define LCD_CS A3
#define LCD_CD A2
#define LCD_WR A1
#define LCD_RD A0
#define LCD_RESET A4

#define TS_MINX 122
#define TS_MINY 111
#define TS_MAXX 942
#define TS_MAXY 890

#define YP A3
#define XM A2
#define YM 9
#define XP 8

#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF

Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);

TouchScreen ts = TouchScreen(XP, YP, XM, YM, 364);

boolean buttonEnabled = true;
volatile int flow_frequency; // Measures flow sensor pulses
unsigned int l_hour; // Calculated litres/hour
const byte flowsensor = 21;
unsigned long currentTime;
unsigned long cloopTime;

void flow () // Interrupt function
{
flow_frequency++;
}

void setup() {

pinMode(flowsensor, INPUT);

digitalWrite(flowsensor, HIGH); // Optional Internal Pull-Up
Serial.begin(9600);
attachInterrupt(digitalPinToInterrupt(flowsensor), flow, RISING); // Setup Interrupt
sei(); // Enable interrupts
currentTime = millis();
cloopTime = currentTime;

tft.reset();
uint16_t identifier = tft.readID();
tft.begin(identifier);
tft.setRotation(1);
tft.fillScreen(WHITE);
tft.drawRect(0,0,319,240,YELLOW);

tft.setCursor(30,40);
tft.setTextColor(BLACK);
tft.setTextSize(2);
tft.print(“WATER FLOW SESOR READING”);

tft.setCursor(115,80);
tft.setTextColor(BLACK);
tft.setTextSize(2);
tft.print(“DATA”);

}

void loop() {

currentTime = millis();
// Every second, calculate and print litres/hour
if(currentTime >= (cloopTime + 1000))
{
cloopTime = currentTime; // Updates cloopTime
// Pulse frequency (Hz) = 7.5Q, Q is flow rate in L/min.
l_hour = (flow_frequency * 60 / 7.5); // (Pulse frequency x 60 min) / 7.5Q = flowrate in L/hour
flow_frequency = 0; // Reset Counter
Serial.print(l_hour, DEC); // Print litres/hour
Serial.println(" L/hour");
tft.setCursor(30,150);
tft.setTextColor(BLUE);
tft.setTextSize(2);
tft.print(l_hour, DEC);

}
}

Your topic has been moved here as this forum section is more appropriate than where it was originally posted.

Please take care to post in the correct forum section

The easier you make it to read and copy the code the more likely it is that you will get help

Please follow the advice given in the link below when posting code

You need to understand the difference between warnings and errors. A warning is the compiler telling you there is something in the code that could possibly cause a problem but doesn’t cause the compilation to fail. An error is a problem with the code that causes compilation to fail. In this case you have posted warnings, not errors.

You should always pay attention to warnings and fix them in your own code whenever possible. Unfortunately some library authors don’t hold themselves to such high standards so sometimes you do just need to ignore a warning from a library that you didn’t write. That can be quite annoying since you are always having to sort though a bunch of warnings in other people’s sloppy code to make sure your own code is of high quality. You may decide it’s worth editing the source of the library to fix the warning. If you do so, it’s a good idea to submit a pull request for the fix to the library’s repository to solve the problem upstream, otherwise the warnings will come back whenever you update to a new release of the library. This will also benefit all the other users of the library.