ESP3D/libraries/TFT_eSPI-2.5.43/examples/320 x 240/TFT_Ellipse/TFT_Ellipse.ino
Luc 93312ff8b5
Idf 5.1.4/Arduino 3.0.4 porting for esp32 (#1046)
* 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
2024-09-05 16:27:47 +08:00

49 lines
843 B
C++

/*
Ellipse drawing example
This sketch does not use any fonts.
*/
#include <TFT_eSPI.h> // Hardware-specific library
#include <SPI.h>
TFT_eSPI tft = TFT_eSPI(); // Invoke custom library
void setup(void) {
tft.init();
tft.setRotation(1);
}
void loop() {
tft.fillScreen(TFT_BLACK);
// Draw some random ellipses
for (int i = 0; i < 40; i++)
{
int rx = random(60);
int ry = random(60);
int x = rx + random(320 - rx - rx);
int y = ry + random(240 - ry - ry);
tft.fillEllipse(x, y, rx, ry, random(0xFFFF));
}
delay(2000);
tft.fillScreen(TFT_BLACK);
for (int i = 0; i < 40; i++)
{
int rx = random(60);
int ry = random(60);
int x = rx + random(320 - rx - rx);
int y = ry + random(240 - ry - ry);
tft.drawEllipse(x, y, rx, ry, random(0xFFFF));
}
delay(2000);
}