I am building a project using an Arduino Uno, an Adafruit 2.8” capacitive touchscreen and a DS3231 Real Time Clock.
To start my sketch off, I copied the header files from the various test sketches into one combined header section. I deleted obvious duplicates. I am now well into my sketch and everything works. However, I think I may have duplicate header files in some cases – the same header file seems to be defined differently. I assume that, if you define a header file twice, you are using twice as much memory?
In particular I seem to have too much with regards to the Adafruit_ILI9341.h
There is -
type or paste code here
#define TFT_DC 9
#define TFT_CS 10
type or paste code here
and
type or paste code here
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
type or paste code here
Here is what I have -
type or paste code here
//This program monitors the run time of a water pump and shuts it down if it runs too long
#include "SPI.h" // this is needed for display
#include "Adafruit_GFX.h" // Core graphics library
#include "Adafruit_ILI9341.h"
// The display also uses hardware SPI, plus #9 & #10
#define TFT_DC 9
#define TFT_CS 10
// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
#include <Wire.h> // this is needed for FT6206
#include <Adafruit_FT6206.h>
// The FT6206 uses hardware I2C (SCL/SDA)
Adafruit_FT6206 ctp = Adafruit_FT6206();
// Date and time functions using a DS3231 RTC connected via I2C and Wire lib
#include "RTClib.h"
RTC_DS3231 rtc;
// DS3231 device address
#define deviceAddress 0b1101000 //0x68
type or paste code here
Any help would be much appreciated, please.