#include <Adafruit_ILI9341.h>
#define TFT_CS 10
#define TFT_DC 9
#define TFT_RST 8
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
void setup() {
tft.begin();
tft.setRotation(3); // Adjust the rotation if needed
}
void loop() {
tft.setRotation(3);
tft.setTextSize(2);
tft.setTextColor(ILI9341_WHITE);
tft.setCursor(0, tft.height());
tft.println("Scrolling Text Demo!");
while (true) {
for (int16_t y = tft.height(); y >= -tft.height(); y--) {
tft.startWrite(); // Enable faster writing for smooth scrolling
tft.fillRect(0, 18, tft.width(), tft.height() - 18, 0, 0); // Scroll up by 18 pixels
tft.fillRect(0, tft.height() - 18, tft.width(), 18, ILI9341_BLACK); // Clear bottom 18 pixels
tft.setCursor(0, y);
tft.print("Scrolling Text Demo!");
tft.endWrite();
delay(50);
}
}
}