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 |
FastLED.ino (1009B)
1 /******************************************************************************* 2 * FastLED GFX Example 3 * This is a simple GFX example for FastLED 4 * 5 * Dependent libraries: 6 * FastLED: https://github.com/FastLED/FastLED.git 7 ******************************************************************************/ 8 #include <Arduino_GFX_Library.h> 9 10 // all settings in header file 11 #include "FastLED_GFX.h" 12 Arduino_GFX *gfx = new FastLED_GFX(); 13 int16_t x; 14 uint16_t w, tw; 15 16 void setup(void) 17 { 18 gfx->begin(); 19 gfx->fillScreen(BLACK); 20 21 x = 0; 22 gfx->setCursor(x, 0); 23 gfx->setTextColor(RED); 24 gfx->println("Hello World!"); 25 26 int16_t x1, y1; 27 uint16_t h; 28 gfx->getTextBounds("Hello World!", 0, 0, &x1, &y1, &w, &h); 29 tw = w; 30 w = gfx->width(); 31 32 delay(1000); // 1 seconds 33 } 34 35 void loop() 36 { 37 x--; 38 if (x < (-tw)) 39 { 40 x = w - 1; 41 } 42 gfx->setCursor(x, 0); 43 gfx->setTextColor(random(0xffff), BLACK); 44 gfx->println("Hello World!"); 45 46 delay(100); // 0.1 second 47 }