/

//

SMALL SCREEN ART

//

For me the art and peace of infinite movement.

///

COMPONENTS

ComponentsNo. of
ESP321
JUMPER WIRES∼ 16
TFT ST7789 LCD DISPLAY1
BREADBOARD1

////

CODE

SIMPLE CODE BREAKDOWN

Display Images in a Loop: The microcontroller continually goes through a list of seven pictures (frames) . It starts with the first picture, shows it briefly, and then moves to the next one.

The result is a moving picture.

Main code
Although this is the main code, there has to be .jpeg files that are the substance of the loop.
#include <TFT_eSPI.h>
#include <SPI.h>
#include "image001.h"
#include "image002.h"
#include "image003.h"
#include "image004.h"
#include "image005.h"
#include "image006.h"
#include "image007.h"

TFT_eSPI tft = TFT_eSPI(); // Invoke custom library

void setup(){
    Serial.begin(115200);
    Serial.println("Start");
    tft.init();
    tft.setRotation(3);
    tft.setSwapBytes(true);
}

void loop(){
    tft.pushImage(0, 0,  320, 240, image001);
    delay(10);  
    tft.pushImage(0, 0,  320, 240, image002);
    delay(40);
    tft.pushImage(0, 0,  320, 240, image003);
    delay(40);
    tft.pushImage(0, 0,  320, 240, image004);
    delay(40);
    tft.pushImage(0, 0,  320, 240, image005);
    delay(40);
    tft.pushImage(0, 0,  320, 240, image006);
    delay(40);
    tft.pushImage(0, 0,  320, 240, image007);
    delay(40);
}

The whole file:

/////

SETUP

Pins used are:

  • 3V3 for LED and VVC,
  • GND for GND,
  • CS screen for D15,
  • CS SD card for D5,
  • RESET for D4,
  • DC for D2,
  • MOSI for D23,
  • SCK for D18.


MOSI and SCK pins are SPI protocol, therefore are able to be occupied by multiple devices.

/////

VIDEO

//////

No comments section here. We like it clean .