mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-10-16 19:01:31 +08:00

* Update WebSocket library * Update SSDP library * Update TFT_eSPI library * Update EspLuaEngine library * Update SDFat library * Change to pioarduino * Make ESP3DMessageFIFO and ESP3DMessage more thread safe * Fix sanity checks for BT * Add some C6 support * Refactor ethernet code * Split Ethernet Sta / WiFi sta ESP Commands and settings * Simplify wait and wdtFeed code * Set C3 with 4MB by default in platformio.ini * Apply Disable brown out only on ESP32 to avoid crash e.g:ESP32S3 * Add missing entries in platformio.ini
39 lines
1.0 KiB
C++
39 lines
1.0 KiB
C++
/*
|
|
This sketch demonstrates the use of the horizontal and vertical gradient
|
|
rectangle fill functions.
|
|
|
|
Example for library:
|
|
https://github.com/Bodmer/TFT_eSPI
|
|
|
|
Created by Bodmer 27/1/22
|
|
*/
|
|
|
|
#include <TFT_eSPI.h> // Include the graphics library
|
|
TFT_eSPI tft = TFT_eSPI(); // Create object "tft"
|
|
|
|
// -------------------------------------------------------------------------
|
|
// Setup
|
|
// -------------------------------------------------------------------------
|
|
void setup(void) {
|
|
tft.init();
|
|
tft.setRotation(1);
|
|
tft.fillScreen(TFT_DARKGREY);
|
|
tft.setTextFont(2);
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
// Main loop
|
|
// -------------------------------------------------------------------------
|
|
void loop()
|
|
{
|
|
tft.fillRectHGradient(0, 0, 160, 50, TFT_MAGENTA, TFT_BLUE);
|
|
tft.setCursor(10,10);
|
|
tft.print("Horizontal gradient");
|
|
|
|
tft.fillRectVGradient(0, 60, 160, 50, TFT_ORANGE, TFT_RED);
|
|
tft.setCursor(10,70);
|
|
tft.print("Vertical gradient");
|
|
|
|
while(1) delay(100); // Wait here
|
|
}
|