#include "Free_Fonts.h"
#include <TFT_eSPI.h>
#include <SPI.h> // this is needed for display
// The display also uses hardware SPI, plus #9 & #10
#define TFT_CS 15
#define TFT_DC 2
#define TFT_MOSI 23
#define TFT_SCLK 18
float dispTemp = 22.3;
TFT_eSPI tft = TFT_eSPI(); // Invoke custom library with default width and height
class SlideMenu{
public:
SlideMenu(int x0, int y0, int w0, int h0, TFT_eSPI tft0):
x(x0),
y(y0),
w(w0),
h(h0)
tft(tft0)
{
}
void render()
{
tft.drawPixel(x, y, TFT_RED);
}
private:
TFT_eSPI& tft;
int x;
int y;
int w;
int h;
};
void setup(void) {
Serial.begin(115200);
tft.begin();
tft.setRotation(1);
tft.fillScreen(TFT_WHITE);
//tft.drawRect(10,50,20,56,TFT_RED);
SlideMenu slideMenu = SlideMenu(319, 0, 50, 240, tft);
slideMenu.render();
}
void loop() {
}