// #include "Free_Fonts.h"
#include <TFT_eSPI.h>
#include <SPI.h> // this is needed for display
#include "Roboto_72.h"
// 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
// #define ROBOTO_B_72 &Roboto_Black_72
TFT_eSPI tft = TFT_eSPI(); // Invoke custom library with default width and height
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
tft.begin();
tft.setRotation(0);
DrawText();
}
void loop() {
// put your main code here, to run repeatedly:
// delay(10); // this speeds up the simulation
}
void DrawText( void )
{
int h = tft.fontHeight( 4 );
tft.setTextDatum( TL_DATUM );
tft.setTextColor( TFT_WHITE, TFT_GREEN );
// tft.setFreeFont( ROBOTO_B_72 );
tft.drawString( "8j", 10, 10, 4 );
tft.drawLine( 10, 10, 100, 10, TFT_RED );
tft.drawLine( 10, 10+h,100, 10+h, TFT_RED );
}
// #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
// void setup(void) {
// tft.begin();
// tft.setRotation(0);
// themeClockTFT(dispTemp, "TEMP", "`C", "88.8", "temp", 1);
// }
// void loop() {
// }
// void themeClockTFT(float value, const String& lable, const String& units, const String& valueSample, const String& valueType, unsigned int accuracy) {
// int xpos = 10;
// int ypos = 45;
// int yPad = 0;
// int padding = tft.textWidth(String(value, accuracy), FONT8);
// tft.setTextDatum(TL_DATUM);
// tft.drawString(lable, xpos, ypos, FONT4);
// tft.setTextDatum(TR_DATUM);
// tft.drawString(units, 240 - xpos, ypos, FONT4);
// tft.setTextDatum(TL_DATUM);
// tft.setTextPadding(padding);
// ypos += tft.fontHeight(FONT8) / 2 + yPad;
// tft.drawFloat(value, accuracy, (240 - padding) / 2, ypos, FONT8);
// tft.setTextPadding(0);
// }