3.5" screen and RTC...I've missed something in code?

Hey guys need a little guidance. I'm making a clock with code this guy supplied on his website, I have the same board, screen and RTC so I thought it should work but I get so many errors. I can post the errors but that's literally 30 pages of them. Something simple has probably gone wrong causing a ton of issues.
If anyone could shed some light on the situation that would be greatly appreciated :slight_smile:
Hope I posted the code correctly and gave enough info...... I'm new here haha I tried.

Keyestudio MEGA
3.5inch screen for MEGA2560
DS3231 RTC

#include <TFT_HX8357_Due.h>
#include <User_Setup.h>







   //////////////////////////////////////////////
  //        3.2" Color RTC PROJECT            //
 //                                          //
//           http://www.educ8s.tv           //
/////////////////////////////////////////////




#include <Sodaq_DS3231.h>  //RTC Library https://github.com/SodaqMoja/Sodaq_DS3231


float minTemperature = 100;
float maxTemperature = -40;
String dateString;
String hours;
int minuteNow=0;
int minutePrevious=0;

TFT_HX8357_Due tft = TFT_HX8357_Due();       // Invoke custom library

void setup()
{  
  rtc.begin();

  tft.init();
  tft.setRotation(1);
  tft.fillScreen(0xC618);
  delay(100);
  printUI();
  
}

void loop()
{
   float temperature = rtc.getTemperature();
   getAndPrintTime();
   printTemperature(temperature);
   if(temperature>maxTemperature)
  {
    maxTemperature = temperature;
    updateMaxTemperature();
  }
  if(temperature<minTemperature)
  {
    minTemperature = temperature;
    updateMinTemperature();
  }

 delay(1000);

}

void printUI()
{ 
 printDateRectangle(); 
 printTemperatureRectangle();
 printMinTemperatureRectangle();
 printMaxTemperatureRectangle();
}

void printDateRectangle()
{
  tft.fillRect(40, 7, 400,60, 0xA000);
  tft.fillRect(40, 5, 400,53, TFT_RED);
}

void printTemperatureRectangle()
{
  tft.fillRect(80, 90, 320, 125, 0x03C0);
  tft.fillRect(80, 90, 320, 120, 0x0640);

  tft.setCursor(320,130);
  tft.setTextColor(TFT_WHITE);
  tft.setTextSize(10);
  tft.print("C");

  tft.setCursor(300,130);
  tft.setTextColor(TFT_WHITE);
  tft.setTextSize(3);
  tft.print("o");

  }

void printMinTemperatureRectangle()
{

  tft.fillRect(40, 251, 160, 59, 0x0015);
  tft.fillRect(40, 251, 160, 55, 0x001C);

  tft.setCursor(175,265);
  tft.setTextColor(TFT_WHITE);
  tft.setTextSize(4);
  tft.print("C");

  tft.setCursor(160,258);
  tft.setTextColor(TFT_WHITE);
  tft.setTextSize(2);
  tft.print("o");

}

void printMaxTemperatureRectangle()
{
  
  tft.fillRect(280, 251, 160, 59, 0x8200);
  tft.fillRect(280, 251, 160, 55, 0xDB20);


  tft.setCursor(415,265);
  tft.setTextColor(TFT_WHITE);
  tft.setTextSize(4);
  tft.print("C");

  tft.setCursor(400,258);
  tft.setTextColor(TFT_WHITE);
  tft.setTextSize(2);
  tft.print("o");
}

void getAndPrintTime()
{
   DateTime now = rtc.now(); //get the current date-time
   minuteNow = now.minute();
   if(minuteNow!=minutePrevious)
   {
      dateString = getDayOfWeek(now.dayOfWeek())+" ";
      dateString = dateString+String(now.date())+"/"+String(now.month());
      minutePrevious = minuteNow;
      hours = String(now.hour());
    if(now.minute()<10)
    {
      hours = hours+":0"+String(now.minute());
    }else
    {
      hours = hours+":"+String(now.minute());
    }
    printTime();
   }
}

void printTime()
{
  String dateAndTime = dateString+" "+hours;

  tft.setTextSize(2);
  char charBuf[25];
  dateAndTime.toCharArray(charBuf, 25);
  
  tft.setTextColor(TFT_WHITE, TFT_RED);
  tft.drawCentreString(charBuf,240,15,2);

}

void setRTCTime()
{
  DateTime dt(2025, 3, 30, 13, 55, 30, 7); // Year, Month, Day, Hour, Minutes, Seconds, Day of Week
  rtc.setDateTime(dt); //Adjust date-time as defined 'dt' above 
}

String getDayOfWeek(int i)
{
  switch(i)
  {
    case 1: return "Monday";break;
    case 2: return "Tuesday";break;
    case 3: return "Wednesday";break;
    case 4: return "Thursday";break;
    case 5: return "Friday";break;
    case 6: return "Saturday";break;
    case 7: return "Sunday";break;
    default: return "Monday";break;
  }
}

void printTemperature(float temperature)
{
  String Temperature;
  Temperature = String(temperature,2); 
  tft.setTextSize(6);
  tft.setCursor(110,130);
  tft.setTextColor(TFT_WHITE, 0x0640);
  tft.print(Temperature);
}

void updateMinTemperature()
{
  String Temperature;
  Temperature = String(minTemperature,2); 
  tft.setTextSize(3);
  tft.setCursor(57,270);
  tft.setTextColor(TFT_WHITE, 0x001C);
  tft.print(Temperature);
  
}

void updateMaxTemperature()
{
  String Temperature;
  Temperature = String(maxTemperature,2); 
  tft.setTextSize(3);
  tft.setCursor(297,270);
  tft.setTextColor(TFT_WHITE, 0xDB20);
  tft.print(Temperature);
}

You may have indeed missed something in the code. Without showing the errors you've made it much harder to tell.

In the absence of any useful information, I can only suggest looking at the first error, fixing that, and repeating.

1 Like

This library was developed to use on Arduino Due. You are using an Arduino Mega clone, and what could be a different LCD.

@h_l Please give better details on the specs of the LCD.

@bodmer can you please comment on compatibility with Mega?

Take a guess:

What guy? What website?

What model of screen? 3.5" is pretty common.

the documentation indicates the TFT_HX8357_Due library is targeted at an Arduino Due
however, you are attempting to use it on a Mega
have you tested the TFT with some of the library example programs to ensure that it works on a Mega?

Ah, hasn't posted in 2 years...

This file is where you configure your devices.

Thankyou all so much for your replies.
this is what I have:

out of stock on an original Mega2560 so I got Keyestudio clone.
out of stock on the 3.2" screen so I got the 3.5" which they said it was the same but bigger.
RTC is the same as what he used.

The LCD has little information it says: (HVGA 480x320 3.5' TFTLCD Shield for Arduino Mega2560)
BUT it does work with the demo examples.

The instructions and video

Maybe if I address the first couple of errors it may fix all the others?
And here are the errors:

Arduino: 1.8.14 (Windows 10), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

WARNING: library TFT_HX8357_Due-master claims to run on sam architecture(s) and may be incompatible with your current board which runs on avr architecture(s).

In file included from C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:69:0:

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp: In member function 'void TFT_HX8357_Due::writecommand(uint8_t)':

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:113:22: error: 'REG_PIOC_CODR' was not declared in this scope

   #define SETUP_CS_L REG_PIOC_CODR = 0x1 << 8

                      ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:192:1: note: in expansion of macro 'SETUP_CS_L'

 SETUP_CS_L;

 ^~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:105:72: error: 'REG_PIOC_SODR' was not declared in this scope

   #define WR_STB REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                                                                        ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:199:1: note: in expansion of macro 'WR_STB'

 WR_STB;

 ^~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp: In member function 'void TFT_HX8357_Due::writedata(uint8_t)':

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:113:22: error: 'REG_PIOC_CODR' was not declared in this scope

   #define SETUP_CS_L REG_PIOC_CODR = 0x1 << 8

                      ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:210:1: note: in expansion of macro 'SETUP_CS_L'

 SETUP_CS_L;

 ^~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:105:72: error: 'REG_PIOC_SODR' was not declared in this scope

   #define WR_STB REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                                                                        ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:216:1: note: in expansion of macro 'WR_STB'

 WR_STB;

 ^~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp: In member function 'void TFT_HX8357_Due::drawChar(int16_t, int16_t, unsigned char, uint16_t, uint16_t, uint8_t)':

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:109:18: error: 'REG_PIOC_CODR' was not declared in this scope

   #define WR_SB  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1242:22: note: in expansion of macro 'WR_SB'

       else bgWrite();WR_SB;

                      ^~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:109:45: error: 'REG_PIOC_SODR' was not declared in this scope

   #define WR_SB  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                                             ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1242:22: note: in expansion of macro 'WR_SB'

       else bgWrite();WR_SB;

                      ^~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:117:18: error: 'REG_PIOC_SODR' was not declared in this scope

     #define CS_H REG_PIOC_SODR = 0x1 << 8

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1254:5: note: in expansion of macro 'CS_H'

     CS_H;

     ^~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp: In member function 'void TFT_HX8357_Due::setWindow(int16_t, int16_t, int16_t, int16_t)':

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:117:18: error: 'REG_PIOC_SODR' was not declared in this scope

     #define CS_H REG_PIOC_SODR = 0x1 << 8

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1463:3: note: in expansion of macro 'CS_H'

   CS_H;

   ^~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp: In member function 'void TFT_HX8357_Due::setAddrWindow(uint16_t, uint16_t, uint16_t, uint16_t)':

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:118:18: error: 'REG_PIOC_CODR' was not declared in this scope

     #define CS_L REG_PIOC_CODR = 0x1 << 8

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1477:3: note: in expansion of macro 'CS_L'

   CS_L;

   ^~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:109:45: error: 'REG_PIOC_SODR' was not declared in this scope

   #define WR_SB  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                                             ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1479:18: note: in expansion of macro 'WR_SB'

   lo_byte(x0>>8);WR_SB;

                  ^~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp: In member function 'void TFT_HX8357_Due::drawPixel(uint16_t, uint16_t, uint16_t)':

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:118:18: error: 'REG_PIOC_CODR' was not declared in this scope

     #define CS_L REG_PIOC_CODR = 0x1 << 8

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1502:3: note: in expansion of macro 'CS_L'

   CS_L;

   ^~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:109:45: error: 'REG_PIOC_SODR' was not declared in this scope

   #define WR_SB  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                                             ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1504:17: note: in expansion of macro 'WR_SB'

   lo_byte(x>>8);WR_SB;

                 ^~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp: In member function 'void TFT_HX8357_Due::pushColor(uint16_t)':

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:118:18: error: 'REG_PIOC_CODR' was not declared in this scope

     #define CS_L REG_PIOC_CODR = 0x1 << 8

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1525:3: note: in expansion of macro 'CS_L'

   CS_L;

   ^~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:105:72: error: 'REG_PIOC_SODR' was not declared in this scope

   #define WR_STB REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                                                                        ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1527:3: note: in expansion of macro 'WR_STB'

   WR_STB;;

   ^~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp: In member function 'void TFT_HX8357_Due::pushColor(uint16_t, uint16_t)':

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:118:18: error: 'REG_PIOC_CODR' was not declared in this scope

     #define CS_L REG_PIOC_CODR = 0x1 << 8

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1538:3: note: in expansion of macro 'CS_L'

   CS_L;

   ^~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:105:72: error: 'REG_PIOC_SODR' was not declared in this scope

   #define WR_STB REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                                                                        ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1543:17: note: in expansion of macro 'WR_STB'

   while(len--) {WR_STB;}

                 ^~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:117:18: error: 'REG_PIOC_SODR' was not declared in this scope

     #define CS_H REG_PIOC_SODR = 0x1 << 8

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1545:3: note: in expansion of macro 'CS_H'

   CS_H;

   ^~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp: In member function 'void TFT_HX8357_Due::pushColors(uint16_t*, uint8_t)':

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:118:18: error: 'REG_PIOC_CODR' was not declared in this scope

     #define CS_L REG_PIOC_CODR = 0x1 << 8

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1559:3: note: in expansion of macro 'CS_L'

   CS_L;

   ^~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:105:72: error: 'REG_PIOC_SODR' was not declared in this scope

   #define WR_STB REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                                                                        ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1564:5: note: in expansion of macro 'WR_STB'

     WR_STB;

     ^~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:117:18: error: 'REG_PIOC_SODR' was not declared in this scope

     #define CS_H REG_PIOC_SODR = 0x1 << 8

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1566:3: note: in expansion of macro 'CS_H'

   CS_H;

   ^~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp: In member function 'void TFT_HX8357_Due::pushColors(uint8_t*, uint16_t)':

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:118:18: error: 'REG_PIOC_CODR' was not declared in this scope

     #define CS_L REG_PIOC_CODR = 0x1 << 8

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1578:3: note: in expansion of macro 'CS_L'

   CS_L;

   ^~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:109:45: error: 'REG_PIOC_SODR' was not declared in this scope

   #define WR_SB  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                                             ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1584:5: note: in expansion of macro 'WR_SB'

     WR_SB;

     ^~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:117:18: error: 'REG_PIOC_SODR' was not declared in this scope

     #define CS_H REG_PIOC_SODR = 0x1 << 8

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1586:3: note: in expansion of macro 'CS_H'

   CS_H;

   ^~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp: In member function 'void TFT_HX8357_Due::pushColor16(uint16_t*, uint16_t)':

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:118:18: error: 'REG_PIOC_CODR' was not declared in this scope

     #define CS_L REG_PIOC_CODR = 0x1 << 8

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1597:3: note: in expansion of macro 'CS_L'

   CS_L;

   ^~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:109:45: error: 'REG_PIOC_SODR' was not declared in this scope

   #define WR_SB  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                                             ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1600:23: note: in expansion of macro 'WR_SB'

     write16(*data++); WR_SB;

                       ^~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:109:45: error: 'REG_PIOC_SODR' was not declared in this scope

   #define WR_SB  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                                             ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1609:36: note: in expansion of macro 'WR_SB'

   while (len--) {write16(*data++); WR_SB;}

                                    ^~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:117:18: error: 'REG_PIOC_SODR' was not declared in this scope

     #define CS_H REG_PIOC_SODR = 0x1 << 8

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1610:3: note: in expansion of macro 'CS_H'

   CS_H;

   ^~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp: In member function 'void TFT_HX8357_Due::drawLine(int16_t, int16_t, int16_t, int16_t, uint16_t)':

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:118:18: error: 'REG_PIOC_CODR' was not declared in this scope

     #define CS_L REG_PIOC_CODR = 0x1 << 8

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1646:3: note: in expansion of macro 'CS_L'

   CS_L;

   ^~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:109:45: error: 'REG_PIOC_SODR' was not declared in this scope

   #define WR_SB  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                                             ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1656:24: note: in expansion of macro 'WR_SB'

         lo_byte(y0>>8);WR_SB;

                        ^~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:109:45: error: 'REG_PIOC_SODR' was not declared in this scope

   #define WR_SB  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                                             ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1690:24: note: in expansion of macro 'WR_SB'

         lo_byte(xs>>8);WR_SB;

                        ^~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:117:18: error: 'REG_PIOC_SODR' was not declared in this scope

     #define CS_H REG_PIOC_SODR = 0x1 << 8

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1715:3: note: in expansion of macro 'CS_H'

   CS_H;

   ^~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp: In member function 'void TFT_HX8357_Due::drawFastVLine(int16_t, int16_t, int16_t, uint16_t)':

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:118:18: error: 'REG_PIOC_CODR' was not declared in this scope

     #define CS_L REG_PIOC_CODR = 0x1 << 8

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1731:3: note: in expansion of macro 'CS_L'

   CS_L;

   ^~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:109:45: error: 'REG_PIOC_SODR' was not declared in this scope

   #define WR_SB  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                                             ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1734:14: note: in expansion of macro 'WR_SB'

   lo_byte1();WR_SB;

              ^~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp: In member function 'void TFT_HX8357_Due::drawFastHLine(int16_t, int16_t, int16_t, uint16_t)':

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:118:18: error: 'REG_PIOC_CODR' was not declared in this scope

     #define CS_L REG_PIOC_CODR = 0x1 << 8

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1786:3: note: in expansion of macro 'CS_L'

   CS_L;

   ^~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:109:45: error: 'REG_PIOC_SODR' was not declared in this scope

   #define WR_SB  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                                             ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1789:17: note: in expansion of macro 'WR_SB'

   lo_byte(x>>8);WR_SB;

                 ^~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp: In member function 'void TFT_HX8357_Due::fillRect(int16_t, int16_t, int16_t, int16_t, uint16_t)':

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:105:18: error: 'REG_PIOC_CODR' was not declared in this scope

   #define WR_STB REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1861:7: note: in expansion of macro 'WR_STB'

       WR_STB;WR_STB;WR_STB;WR_STB;

       ^~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:105:72: error: 'REG_PIOC_SODR' was not declared in this scope

   #define WR_STB REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                                                                        ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1861:7: note: in expansion of macro 'WR_STB'

       WR_STB;WR_STB;WR_STB;WR_STB;

       ^~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:105:18: error: 'REG_PIOC_CODR' was not declared in this scope

   #define WR_STB REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1876:7: note: in expansion of macro 'WR_STB'

       WR_STB;WR_STB;WR_STB;WR_STB;

       ^~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:105:72: error: 'REG_PIOC_SODR' was not declared in this scope

   #define WR_STB REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                                                                        ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1876:7: note: in expansion of macro 'WR_STB'

       WR_STB;WR_STB;WR_STB;WR_STB;

       ^~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:105:18: error: 'REG_PIOC_CODR' was not declared in this scope

   #define WR_STB REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1882:19: note: in expansion of macro 'WR_STB'

     while(hw--) { WR_STB;}

                   ^~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:105:72: error: 'REG_PIOC_SODR' was not declared in this scope

   #define WR_STB REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                                                                        ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1882:19: note: in expansion of macro 'WR_STB'

     while(hw--) { WR_STB;}

                   ^~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:117:18: error: 'REG_PIOC_SODR' was not declared in this scope

     #define CS_H REG_PIOC_SODR = 0x1 << 8

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:1888:3: note: in expansion of macro 'CS_H'

   CS_H;

   ^~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp: In member function 'int16_t TFT_HX8357_Due::drawChar(uint16_t, int16_t, int16_t, int16_t)':

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:109:18: error: 'REG_PIOC_CODR' was not declared in this scope

   #define WR_SB  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2305:25: note: in expansion of macro 'WR_SB'

         else bgWrite(); WR_SB;

                         ^~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:109:45: error: 'REG_PIOC_SODR' was not declared in this scope

   #define WR_SB  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                                             ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2305:25: note: in expansion of macro 'WR_SB'

         else bgWrite(); WR_SB;

                         ^~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:117:18: error: 'REG_PIOC_SODR' was not declared in this scope

     #define CS_H REG_PIOC_SODR = 0x1 << 8

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2322:7: note: in expansion of macro 'CS_H'

       CS_H;

       ^~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:105:18: error: 'REG_PIOC_CODR' was not declared in this scope

   #define WR_STB REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2383:37: note: in expansion of macro 'WR_STB'

               while (tnp) { tnp-=4; WR_STB;WR_STB;WR_STB;WR_STB; }

                                     ^~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:105:72: error: 'REG_PIOC_SODR' was not declared in this scope

   #define WR_STB REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                                                                        ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2383:37: note: in expansion of macro 'WR_STB'

               while (tnp) { tnp-=4; WR_STB;WR_STB;WR_STB;WR_STB; }

                                     ^~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:109:18: error: 'REG_PIOC_CODR' was not declared in this scope

   #define WR_SB  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2385:20: note: in expansion of macro 'WR_SB'

             else { WR_SB; }

                    ^~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:109:45: error: 'REG_PIOC_SODR' was not declared in this scope

   #define WR_SB  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                                             ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2385:20: note: in expansion of macro 'WR_SB'

             else { WR_SB; }

                    ^~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:117:18: error: 'REG_PIOC_SODR' was not declared in this scope

     #define CS_H REG_PIOC_SODR = 0x1 << 8

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2402:7: note: in expansion of macro 'CS_H'

       CS_H;

       ^~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:101:16: error: 'REG_PIOC_SODR' was not declared in this scope

   #define WR_H REG_PIOC_SODR = 0x1 << 7

                ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2437:22: note: in expansion of macro 'WR_H'

           fgWrite(); WR_H;

                      ^~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:101:16: error: 'REG_PIOC_SODR' was not declared in this scope

   #define WR_H REG_PIOC_SODR = 0x1 << 7

                ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2440:22: note: in expansion of macro 'WR_H'

           bgWrite(); WR_H;

                      ^~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:105:18: error: 'REG_PIOC_CODR' was not declared in this scope

   #define WR_STB REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2444:33: note: in expansion of macro 'WR_STB'

         while(line>3){ line-=4; WR_STB; WR_STB; WR_STB; WR_STB; }

                                 ^~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:105:72: error: 'REG_PIOC_SODR' was not declared in this scope

   #define WR_STB REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                                                                        ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2444:33: note: in expansion of macro 'WR_STB'

         while(line>3){ line-=4; WR_STB; WR_STB; WR_STB; WR_STB; }

                                 ^~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:105:18: error: 'REG_PIOC_CODR' was not declared in this scope

   #define WR_STB REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2445:33: note: in expansion of macro 'WR_STB'

         while(line)  { line--;  WR_STB;}

                                 ^~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:105:72: error: 'REG_PIOC_SODR' was not declared in this scope

   #define WR_STB REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_CODR = 0x1 << 7;  REG_PIOC_SODR = 0x1 << 7;

                                                                        ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2445:33: note: in expansion of macro 'WR_STB'

         while(line)  { line--;  WR_STB;}

                                 ^~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:117:18: error: 'REG_PIOC_SODR' was not declared in this scope

     #define CS_H REG_PIOC_SODR = 0x1 << 8

                  ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2448:7: note: in expansion of macro 'CS_H'

       CS_H;

       ^~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp: In member function 'void TFT_HX8357_Due::write16(uint16_t)':

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2827:3: error: 'REG_PIOA_CODR' was not declared in this scope

   REG_PIOA_CODR = 0b00000000000000001100000010000000; // Clear bits

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2828:3: error: 'REG_PIOB_CODR' was not declared in this scope

   REG_PIOB_CODR = 0b00000100000000000000000000000000; // Clear bits

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2830:3: error: 'REG_PIOC_CODR' was not declared in this scope

   REG_PIOC_CODR = 0b00000000000000000000000010111110; // Clear WR bit as well

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2831:3: error: 'REG_PIOD_CODR' was not declared in this scope

   REG_PIOD_CODR = 0b00000000000000000000011001001111; // Clear bits

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2835:20: error: 'REG_PIOD_SODR' was not declared in this scope

   if (word&0x8000) REG_PIOD_SODR = 0x1 << 6;  // D.6

                    ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2836:20: error: 'REG_PIOD_SODR' was not declared in this scope

   if (word&0x4000) REG_PIOD_SODR = 0x1 << 3;  // D.3

                    ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2837:20: error: 'REG_PIOD_SODR' was not declared in this scope

   if (word&0x2000) REG_PIOD_SODR = 0x1 << 2;  // D.2

                    ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2838:20: error: 'REG_PIOD_SODR' was not declared in this scope

   if (word&0x1000) REG_PIOD_SODR = 0x1 << 1;  // D.1

                    ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2839:20: error: 'REG_PIOD_SODR' was not declared in this scope

   if (word&0x0800) REG_PIOD_SODR = 0x1 << 0;  // D.0

                    ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2840:20: error: 'REG_PIOA_SODR' was not declared in this scope

   if (word&0x0400) REG_PIOA_SODR = 0x1 << 15; // A.15

                    ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2841:20: error: 'REG_PIOA_SODR' was not declared in this scope

   if (word&0x0200) REG_PIOA_SODR = 0x1 << 14; // A.14

                    ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2842:20: error: 'REG_PIOB_SODR' was not declared in this scope

   if (word&0x0100) REG_PIOB_SODR = 0x1 << 26; // B.26

                    ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2845:20: error: 'REG_PIOD_SODR' was not declared in this scope

   if (word&0x0080) REG_PIOD_SODR = 0x1 << 9;  // D.9

                    ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2846:20: error: 'REG_PIOA_SODR' was not declared in this scope

   if (word&0x0040) REG_PIOA_SODR = 0x1 << 7;  // A.7

                    ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2847:20: error: 'REG_PIOD_SODR' was not declared in this scope

   if (word&0x0020) REG_PIOD_SODR = 0x1 << 10; // D.10

                    ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2848:20: error: 'REG_PIOC_SODR' was not declared in this scope

   if (word&0x0010) REG_PIOC_SODR = 0x1 << 1;  // C.1

                    ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2849:20: error: 'REG_PIOC_SODR' was not declared in this scope

   if (word&0x0008) REG_PIOC_SODR = 0x1 << 2;  // C.2

                    ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2850:20: error: 'REG_PIOC_SODR' was not declared in this scope

   if (word&0x0004) REG_PIOC_SODR = 0x1 << 3;  // C.3

                    ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2851:20: error: 'REG_PIOC_SODR' was not declared in this scope

   if (word&0x0002) REG_PIOC_SODR = 0x1 << 4;  // C.4

                    ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2852:20: error: 'REG_PIOC_SODR' was not declared in this scope

   if (word&0x0001) REG_PIOC_SODR = 0x1 << 5;  // C.5

                    ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp: In member function 'void TFT_HX8357_Due::lo_byte(uint16_t)':

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2863:3: error: 'REG_PIOA_CODR' was not declared in this scope

   REG_PIOA_CODR = 0b00000000000000000000000010000000; // Clear bits

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2865:3: error: 'REG_PIOC_CODR' was not declared in this scope

   REG_PIOC_CODR = 0b00000000000000000000000010111110; // Clear WR bit as well

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2866:3: error: 'REG_PIOD_CODR' was not declared in this scope

   REG_PIOD_CODR = 0b00000000000000000000011000000000; // Clear bits

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2870:16: error: 'REG_PIOD_SODR' was not declared in this scope

   if (lo&0x80) REG_PIOD_SODR = 0x1 << 9;  // D.9

                ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2871:16: error: 'REG_PIOA_SODR' was not declared in this scope

   if (lo&0x40) REG_PIOA_SODR = 0x1 << 7;  // A.7

                ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2872:16: error: 'REG_PIOD_SODR' was not declared in this scope

   if (lo&0x20) REG_PIOD_SODR = 0x1 << 10; // D.10

                ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2873:16: error: 'REG_PIOC_SODR' was not declared in this scope

   if (lo&0x10) REG_PIOC_SODR = 0x1 << 1;  // C.1

                ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2874:16: error: 'REG_PIOC_SODR' was not declared in this scope

   if (lo&0x08) REG_PIOC_SODR = 0x1 << 2;  // C.2

                ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2875:16: error: 'REG_PIOC_SODR' was not declared in this scope

   if (lo&0x04) REG_PIOC_SODR = 0x1 << 3;  // C.3

                ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2876:16: error: 'REG_PIOC_SODR' was not declared in this scope

   if (lo&0x02) REG_PIOC_SODR = 0x1 << 4;  // C.4

                ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2877:16: error: 'REG_PIOC_SODR' was not declared in this scope

   if (lo&0x01) REG_PIOC_SODR = 0x1 << 5;  // C.5

                ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp: In member function 'void TFT_HX8357_Due::lo_byte1()':

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2912:3: error: 'REG_PIOA_CODR' was not declared in this scope

   REG_PIOA_CODR = 0b00000000000000000000000010000000; // Clear bits

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2914:3: error: 'REG_PIOC_CODR' was not declared in this scope

   REG_PIOC_CODR = 0b00000000000000000000000010111110; // Clear WR bit as well

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2915:3: error: 'REG_PIOD_CODR' was not declared in this scope

   REG_PIOD_CODR = 0b00000000000000000000011000000000; // Clear bits

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2917:3: error: 'REG_PIOA_SODR' was not declared in this scope

   REG_PIOA_SODR = lo1A;

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2918:3: error: 'REG_PIOC_SODR' was not declared in this scope

   REG_PIOC_SODR = lo1C;

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2919:3: error: 'REG_PIOD_SODR' was not declared in this scope

   REG_PIOD_SODR = lo1D;

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp: In member function 'void TFT_HX8357_Due::lo_byte2()':

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2925:3: error: 'REG_PIOA_CODR' was not declared in this scope

   REG_PIOA_CODR = 0b00000000000000000000000010000000; // Clear bits

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2927:3: error: 'REG_PIOC_CODR' was not declared in this scope

   REG_PIOC_CODR = 0b00000000000000000000000010111110; // Clear WR bit as well

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2928:3: error: 'REG_PIOD_CODR' was not declared in this scope

   REG_PIOD_CODR = 0b00000000000000000000011000000000; // Clear bits

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2929:3: error: 'REG_PIOA_SODR' was not declared in this scope

   REG_PIOA_SODR = lo2A;

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2930:3: error: 'REG_PIOC_SODR' was not declared in this scope

   REG_PIOC_SODR = lo2C;

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:2931:3: error: 'REG_PIOD_SODR' was not declared in this scope

   REG_PIOD_SODR = lo2D;

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp: In member function 'void TFT_HX8357_Due::addrCmd(uint8_t)':

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3009:3: error: 'REG_PIOA_CODR' was not declared in this scope

   REG_PIOA_CODR = 0b00000000000000000000000010000000; // Clear bits in A

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3010:3: error: 'REG_PIOD_CODR' was not declared in this scope

   REG_PIOD_CODR = 0b00000000000000000000011000000000; // Clear bits in D

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3011:3: error: 'REG_PIOD_SODR' was not declared in this scope

   REG_PIOD_SODR = 0b00000000000000000000010000000000; // Set common bits in D

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3013:3: error: 'REG_PIOC_CODR' was not declared in this scope

   REG_PIOC_CODR = 0b00000000000000000000000011111110; // Clear RS and bits in C

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3016:3: error: 'REG_PIOC_SODR' was not declared in this scope

   REG_PIOC_SODR = 0b00000000000000000000000000010100; // Write the CASET specific bits

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3018:3: error: 'REG_PIOC_SODR' was not declared in this scope

   REG_PIOC_SODR = 0b00000000000000000000000000110100; // Write the PASET specific bits

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3020:3: error: 'REG_PIOC_SODR' was not declared in this scope

   REG_PIOC_SODR = 0b00000000000000000000000000001100; // Write the RAMWR specific bits

   ^~~~~~~~~~~~~

In file included from C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:69:0:

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.h:101:16: error: 'REG_PIOC_SODR' was not declared in this scope

   #define WR_H REG_PIOC_SODR = 0x1 << 7

                ^

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3021:3: note: in expansion of macro 'WR_H'

   WR_H;

   ^~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp: In member function 'void TFT_HX8357_Due::caset()':

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3028:3: error: 'REG_PIOA_CODR' was not declared in this scope

   REG_PIOA_CODR = 0b00000000000000000000000010000000; // Clear bits in A

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3029:3: error: 'REG_PIOD_CODR' was not declared in this scope

   REG_PIOD_CODR = 0b00000000000000000000011000000000; // Clear bits in D

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3030:3: error: 'REG_PIOD_SODR' was not declared in this scope

   REG_PIOD_SODR = 0b00000000000000000000010000000000; // Set common bits in D

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3032:3: error: 'REG_PIOC_CODR' was not declared in this scope

   REG_PIOC_CODR = 0b00000000000000000000000011111110; // Clear RS and bits in C

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3034:3: error: 'REG_PIOC_SODR' was not declared in this scope

   REG_PIOC_SODR = 0b00000000000000000000000000010100; // Write the CASET specific bits

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp: In member function 'void TFT_HX8357_Due::paset()':

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3043:3: error: 'REG_PIOA_CODR' was not declared in this scope

   REG_PIOA_CODR = 0b00000000000000000000000010000000; // Clear bits in A

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3044:3: error: 'REG_PIOD_CODR' was not declared in this scope

   REG_PIOD_CODR = 0b00000000000000000000011000000000; // Clear bits in D

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3045:3: error: 'REG_PIOD_SODR' was not declared in this scope

   REG_PIOD_SODR = 0b00000000000000000000010000000000; // Set common bits in D

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3047:3: error: 'REG_PIOC_CODR' was not declared in this scope

   REG_PIOC_CODR = 0b00000000000000000000000011111110; // Clear RS and bits in C

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3049:3: error: 'REG_PIOC_SODR' was not declared in this scope

   REG_PIOC_SODR = 0b00000000000000000000000000110100; // Write the PASET specific bits

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp: In member function 'void TFT_HX8357_Due::ramwr()':

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3058:3: error: 'REG_PIOA_CODR' was not declared in this scope

   REG_PIOA_CODR = 0b00000000000000000000000010000000; // Clear bits in A

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3059:3: error: 'REG_PIOD_CODR' was not declared in this scope

   REG_PIOD_CODR = 0b00000000000000000000011000000000; // Clear bits in D

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3060:3: error: 'REG_PIOD_SODR' was not declared in this scope

   REG_PIOD_SODR = 0b00000000000000000000010000000000; // Set common bits in D

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3062:3: error: 'REG_PIOC_CODR' was not declared in this scope

   REG_PIOC_CODR = 0b00000000000000000000000011111110; // Clear RS and bits in C

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3064:3: error: 'REG_PIOC_SODR' was not declared in this scope

   REG_PIOC_SODR = 0b00000000000000000000000000001100; // Write the RAMWR specific bits

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp: In member function 'void TFT_HX8357_Due::fgWrite()':

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3078:3: error: 'REG_PIOA_CODR' was not declared in this scope

   REG_PIOA_CODR = 0b00000000000000001100000010000000; // Clear bits

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3079:3: error: 'REG_PIOA_SODR' was not declared in this scope

   REG_PIOA_SODR = fgA;                                // Now write the bits

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3082:3: error: 'REG_PIOB_CODR' was not declared in this scope

   REG_PIOB_CODR = 0b00000100000000000000000000000000; // Clear bits

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3083:3: error: 'REG_PIOB_SODR' was not declared in this scope

   REG_PIOB_SODR = fgB;                                // Now write the bits

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3086:3: error: 'REG_PIOC_CODR' was not declared in this scope

   REG_PIOC_CODR = 0b00000000000000000000000010111110; // Clear bits and WR low

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3087:3: error: 'REG_PIOC_SODR' was not declared in this scope

   REG_PIOC_SODR = fgC;                                // Now write the bits

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3090:3: error: 'REG_PIOD_CODR' was not declared in this scope

   REG_PIOD_CODR = 0b00000000000000000000011001001111; // Clear bits

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3091:3: error: 'REG_PIOD_SODR' was not declared in this scope

   REG_PIOD_SODR = fgD;                                // Now write the bits

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp: In member function 'void TFT_HX8357_Due::bgWrite()':

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3102:3: error: 'REG_PIOA_CODR' was not declared in this scope

   REG_PIOA_CODR = 0b00000000000000001100000010000000; // Clear bits

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3103:3: error: 'REG_PIOA_SODR' was not declared in this scope

   REG_PIOA_SODR = bgA;                                // Now write the bits

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3106:3: error: 'REG_PIOB_CODR' was not declared in this scope

   REG_PIOB_CODR = 0b00000100000000000000000000000000; // Clear bits

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3107:3: error: 'REG_PIOB_SODR' was not declared in this scope

   REG_PIOB_SODR = bgB;                                // Now write the bits

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3110:3: error: 'REG_PIOC_CODR' was not declared in this scope

   REG_PIOC_CODR = 0b00000000000000000000000010111110; // Clear bits and WR low

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3111:3: error: 'REG_PIOC_SODR' was not declared in this scope

   REG_PIOC_SODR = bgC;                                // Now write the bits

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3114:3: error: 'REG_PIOD_CODR' was not declared in this scope

   REG_PIOD_CODR = 0b00000000000000000000011001001111; // Clear bits

   ^~~~~~~~~~~~~

C:\Users\Home\Documents\Arduino\libraries\TFT_HX8357_Due-master\TFT_HX8357_Due.cpp:3115:3: error: 'REG_PIOD_SODR' was not declared in this scope

   REG_PIOD_SODR = bgD;                                // Now write the bits

   ^~~~~~~~~~~~~

exit status 1

Error compiling for board Arduino Mega or Mega 2560.



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Would that equal

#include RTC_is_the_same_as_what_he_used.h

?

1 Like

This says you are using the Due.

This says you are using Mega2560

Looks like the TFT_HX8357_Due-master library is directly using processor registers, that will never work on a Mega. You will have to adapt the sketch to whatever library is used for your specific display. The sketch is fairly short, and the tft functions seem pretty standard, so likely not a lot of work.

what library do the working demo examples use?
post one of the working examples?

Is this the device?

The RTC is a DS3231

I'm not sure, one of the many I installed trying to get the sketch to work, I go to Examples---->TFT_HX8357 ----> UTFT_Demo_480x320
it brings up the code then I hit upload and it just works.

// Demo based on:
// UTFT_Demo by Henning Karlsen
// web: http://www.henningkarlsen.com/electronics
/*

 The delay between tests is set to 0. The tests run so fast you will need to
 change the WAIT value below to see what is being plotted!
 
 This sketch uses the GLCD and font 2 only.

 Make sure all the required fonts are loaded by editting the
 User_Setup.h file in the TFT_ILI9341 library folder.

 If using an UNO or Mega (ATmega328 or ATmega2560 processor) then for best
 performance use the F_AS_T option found in the User_Setup.h file in the
 TFT_ILI9341 library folder.

  #########################################################################
  ###### DON'T FORGET TO UPDATE THE User_Setup.h FILE IN THE LIBRARY ######
  ######            TO SELECT THE FONTS YOU USE, SEE ABOVE           ######
  #########################################################################
 */

// Delay between demo pages
#define WAIT 2000 // Delay between tests, set to 0 to demo speed, 2000 to see what it does!

#define CENTRE 240

#include <TFT_HX8357.h> // Hardware-specific library

TFT_HX8357 tft = TFT_HX8357();       // Invoke custom library

#define TFT_GREY 0x7BEF

uint32_t runTime = 0;

void setup()
{
  randomSeed(analogRead(0));
  Serial.begin(38400);
// Setup the LCD
  tft.init();
  tft.setRotation(1);
}

void loop()
{
  int buf[478];
  int x, x2;
  int y, y2;
  int r;

  runTime = millis();
// Clear the screen and draw the frame
  tft.fillScreen(TFT_BLACK);

  tft.fillRect(0, 0, 480, 13, TFT_RED);

  tft.fillRect(0, 305, 480, 320, TFT_GREY);
  tft.setTextColor(TFT_BLACK,TFT_RED);

  tft.drawCentreString("* TFT_HX8357 *", CENTRE, 3, 1);
  tft.setTextColor(TFT_YELLOW,TFT_GREY);
  tft.drawCentreString("Adapted by Bodmer", CENTRE, 309,1);

  tft.drawRect(0, 14, 479, 305-14, TFT_BLUE);

// Draw crosshairs
  tft.drawLine(239, 15, 239, 304, TFT_BLUE);
  tft.drawLine(1, 159, 478, 159, TFT_BLUE);
  for (int i=9; i<470; i+=10)
    tft.drawLine(i, 157, i, 161, TFT_BLUE);
  for (int i=19; i<220; i+=10)
    tft.drawLine(237, i, 241, i, TFT_BLUE);

// Draw sin-, cos- and tan-lines  
  tft.setTextColor(TFT_CYAN);
  tft.drawString("Sin", 5, 15,2);
  for (int i=1; i<478; i++)
  {
    tft.drawPixel(i,159+(sin(((i*1.13)*3.14)/180)*95),TFT_CYAN);
  }
  
  tft.setTextColor(TFT_RED);
  tft.drawString("Cos", 5, 30,2);
  for (int i=1; i<478; i++)
  {
    tft.drawPixel(i,159+(cos(((i*1.13)*3.14)/180)*95),TFT_RED);
  }

  tft.setTextColor(TFT_YELLOW);
  tft.drawString("Tan", 5, 45,2);
  for (int i=1; i<478; i++)
  {
    tft.drawPixel(i,159+(tan(((i*1.13)*3.14)/180)),TFT_YELLOW);
  }

  delay(WAIT);

  tft.fillRect(1,15,478-1,304-15,TFT_BLACK);
  tft.drawLine(239, 15, 239, 304,TFT_BLUE);
  tft.drawLine(1, 159, 478, 159,TFT_BLUE);

// Draw a moving sinewave
int col = 0;
  x=1;
  for (int i=1; i<(477*15); i++) 
  {
    x++;
    if (x==478)
      x=1;
    if (i>478)
    {
      if ((x==239)||(buf[x-1]==159))
        col = TFT_BLUE;
      else
        tft.drawPixel(x,buf[x-1],TFT_BLACK);
    }
    y=159+(sin(((i*0.7)*3.14)/180)*(90-(i / 100)));
    tft.drawPixel(x,y, TFT_BLUE);
    buf[x-1]=y;
  }

  delay(WAIT);
  
  tft.fillRect(1,15,478-1,304-15,TFT_BLACK);

// Draw some filled rectangles
  for (int i=1; i<6; i++)
  {
    switch (i)
    {
      case 1:
        col = TFT_MAGENTA;
        break;
      case 2:
        col = TFT_RED;
        break;
      case 3:
        col = TFT_GREEN;
        break;
      case 4:
        col = TFT_BLUE;
        break;
      case 5:
        col = TFT_YELLOW;
        break;
    }
    tft.fillRect(150+(i*20), 70+(i*20), 60, 60,col);
  }

  delay(WAIT);
  
  tft.fillRect(1,15,478-1,304-15,TFT_BLACK);

// Draw some filled, rounded rectangles
  for (int i=1; i<6; i++)
  {
    switch (i)
    {
      case 1:
        col = TFT_MAGENTA;
        break;
      case 2:
        col = TFT_RED;
        break;
      case 3:
        col = TFT_GREEN;
        break;
      case 4:
        col = TFT_BLUE;
        break;
      case 5:
        col = TFT_YELLOW;
        break;
    }
    tft.fillRoundRect(270-(i*20), 70+(i*20), 60, 60, 3, col);
  }
  
  delay(WAIT);
  
  tft.fillRect(1,15,478-1,304-15,TFT_BLACK);

// Draw some filled circles
  for (int i=1; i<6; i++)
  {
    switch (i)
    {
      case 1:
        col = TFT_MAGENTA;
        break;
      case 2:
        col = TFT_RED;
        break;
      case 3:
        col = TFT_GREEN;
        break;
      case 4:
        col = TFT_BLUE;
        break;
      case 5:
        col = TFT_YELLOW;
        break;
    }
    tft.fillCircle(180+(i*20),100+(i*20), 30,col);
  }
  
  delay(WAIT);
  
  tft.fillRect(1,15,478-1,304-15,TFT_BLACK);

// Draw some lines in a pattern

  for (int i=15; i<304; i+=5)
  {
    tft.drawLine(1, i, (i*1.6)-10, 303, TFT_RED);
  }

  for (int i=304; i>15; i-=5)
  {
    tft.drawLine(477, i, (i*1.6)-11, 15, TFT_RED);
  }

  for (int i=304; i>15; i-=5)
  {
    tft.drawLine(1, i, 491-(i*1.6), 15, TFT_CYAN);
  }

  for (int i=15; i<304; i+=5)
  {
    tft.drawLine(477, i, 490-(i*1.6), 303, TFT_CYAN);
  }
  
  delay(WAIT);
  
  tft.fillRect(1,15,478-1,304-15,TFT_BLACK);

// Draw some random circles
  for (int i=0; i<100; i++)
  {
    x=32+random(416);
    y=45+random(226);
    r=random(30);
    tft.drawCircle(x, y, r,random(0xFFFF));
  }

  delay(WAIT);
  
  tft.fillRect(1,15,478-1,304-15,TFT_BLACK);

// Draw some random rectangles
  for (int i=0; i<100; i++)
  {
    x=2+random(476);
    y=16+random(289);
    x2=2+random(476);
    y2=16+random(289);
    if (x2<x) {
      r=x;x=x2;x2=r;
    }
    if (y2<y) {
      r=y;y=y2;y2=r;
    }
    tft.drawRect(x, y, x2-x, y2-y,random(0xFFFF));
  }

  delay(WAIT);
  
  tft.fillRect(1,15,478-1,304-15,TFT_BLACK);

// Draw some random rounded rectangles
  for (int i=0; i<100; i++)
  {
    x=2+random(476);
    y=16+random(289);
    x2=2+random(476);
    y2=16+random(289);
    if (x2<x) {
      r=x;x=x2;x2=r;
    }
    if (y2<y) {
      r=y;y=y2;y2=r;
    }
    tft.drawRoundRect(x, y, x2-x, y2-y, 3,random(0xFFFF));
  }

  delay(WAIT);
  
  tft.fillRect(1,15,478-1,304-15,TFT_BLACK);

  for (int i=0; i<100; i++)
  {
    x=2+random(476);
    y=16+random(289);
    x2=2+random(476);
    y2=16+random(289);
    col=random(0xFFFF);
    tft.drawLine(x, y, x2, y2,col);
  }

  delay(WAIT);
  
  tft.fillRect(1,15,478-1,304-15,TFT_BLACK);

  for (int i=0; i<10000; i++)
  {
    tft.drawPixel(2+random(476), 16+random(289),random(0xFFFF));
  }

  delay(WAIT);

  tft.fillRect(0, 0, 480, 320, TFT_BLUE);

  tft.fillRoundRect(160, 70, 319-160, 169-70, 3,TFT_RED);
  
  tft.setTextColor(TFT_WHITE,TFT_RED);
  tft.drawCentreString("That's it!", CENTRE, 93,2);
  tft.drawCentreString("Restarting in a", CENTRE, 119, 2);
  tft.drawCentreString("few seconds...", CENTRE, 132, 2);

  tft.setTextColor(TFT_GREEN,TFT_BLUE);
  tft.drawCentreString("Runtime: (msecs)", CENTRE, 280, 2);
  tft.setTextDatum(TC_DATUM);
  runTime = millis()-runTime;
  tft.drawNumber(runTime, CENTRE, 300,2);
  tft.setTextDatum(TL_DATUM);
  delay (10000);
}

No it's this one

486521050-1151442860042998-4253358028481035736-n

486023911-1391310962298788-4028473139230656625-n

Okay. Put all that information in one post.

What works? What is the issue?

if the

#include <TFT_HX8357.h> // Hardware-specific library

in post 14 works on the Mega why are you attempting to use (post 1)

#include <TFT_HX8357_Due.h>

which is aimed at an Arduino Due

487164840-2059837671163913-377279779425107505-n

I got it working!!!!!
What I did was change everywhere it said TFT_HX8357_Due.h throughout the code to TFT_HX8357.h just deleted the Due off the end and now it works.

I would like to change the font so my elderly father can read it better as it's a bit blocky like it's low resolution but someone said you can't as the font is built into the screen, is this correct?

I also would like to change it to 12hour time and add am and pm which I can't find where it says about 24h time so I can change it......or maybe that's in the RTC itself?

Thanks once again

Well... that's what people told you all along :grinning_face_with_smiling_eyes:

The time format should be avail in the library.

Congrats that you got it working :upside_down_face: