acid-drop

- Hacking the planet from a LilyGo T-Deck using custom firmware
git clone git://git.acid.vegas/acid-drop.git
Log | Files | Refs | Archive | README | LICENSE

TFT_Ellipse.ino (889B)

      1 /*
      2   Ellipse drawing example
      3   
      4   This sketch does not use any fonts.
      5 */
      6 
      7 #include <TFT_eSPI.h> // Hardware-specific library
      8 #include <SPI.h>
      9 
     10 TFT_eSPI tft = TFT_eSPI();       // Invoke custom library
     11 
     12 void setup(void) {
     13   tft.init();
     14 
     15   tft.setRotation(1);
     16 
     17 }
     18 
     19 void loop() {
     20 
     21   tft.fillScreen(TFT_BLACK);
     22 
     23   // Draw some random filled elipses
     24   for (int i = 0; i < 20; i++)
     25   {
     26     int rx = random(40);
     27     int ry = random(40);
     28     int x = rx + random(160 - rx - rx);
     29     int y = ry + random(128 - ry - ry);
     30     tft.fillEllipse(x, y, rx, ry, random(0xFFFF));
     31   }
     32 
     33   delay(2000);
     34   tft.fillScreen(TFT_BLACK);
     35 
     36   // Draw some random outline elipses
     37   for (int i = 0; i < 20; i++)
     38   {
     39     int rx = random(40);
     40     int ry = random(40);
     41     int x = rx + random(160 - rx - rx);
     42     int y = ry + random(128 - ry - ry);
     43     tft.drawEllipse(x, y, rx, ry, random(0xFFFF));
     44   }
     45 
     46   delay(2000);
     47 }
     48 
     49 
     50