Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SPI.h>
- #include <ILI9488_t3.h>
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- #define TFT_RST 8
- #define TFT_DC 10
- #define TFT_CS 9
- #define TFT_SCK 13
- #define TFT_MISO 12
- #define TFT_MOSI 11
- ILI9488_t3 tft = ILI9488_t3(&SPI, TFT_CS, TFT_DC, TFT_RST);
- //ILI9488_t3 tft = ILI9488_t3(TFT_CS, TFT_DC, TFT_RST, TFT_MOSI, TFT_SCK, TFT_MISO);
- DMAMEM RAFB fb1[480 * 320];
- #define SPI_SPEED 40000000
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- unsigned long previousMillis = 0;
- long interval = 40;
- int dummyX=10;
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- void setup() {
- Serial.begin(9600);
- tft.begin(SPI_SPEED);
- tft.setRotation(3);
- tft.setFrameBuffer(fb1);
- tft.useFrameBuffer(true);
- //tft.updateChangedAreasOnly(true);
- tft.fillScreen(ILI9488_BLACK);
- tft.setTextColor(ILI9488_WHITE); tft.setTextSize(2);
- tft.setCursor(20,65); tft.print("HELLO");
- tft.updateScreen();
- delay(1500);
- interval = 40;
- }
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- void loop() {
- unsigned long currentMillis = millis();
- if(currentMillis-previousMillis >=interval){
- previousMillis = currentMillis;
- tft.fillScreen(ILI9488_BLACK);
- tft.drawLine(dummyX,0,dummyX,320,ILI9488_RED);
- dummyX+=20; dummyX%=480;
- }
- tft.updateScreen();
- }
Advertisement
Add Comment
Please, Sign In to add comment