QR Code displayed on a 1.54″ TFT LCD Display with ESP8266

Description: A QR Code .bmp file is uploaded to a Micro-SD Card and displayed on a 1.54″ TFT LCD with a Wemos Lolin D1 Mini Pro V2.

QR Code displayed on 1.54 TFT LCD Display with ESP8266

Notes: In order for an image to be displayed on the LCD it must be converted to .bmp format and then uploaded to the folder named “picture” on the Micro-SD card. An image can be converted online to bmp with: Online-Convert.


1 – Breadboard 400 Points
1 – Wemos Lolin D1 Mini Pro V2
1 – 1.54” 240×240 TFT LCD Display with MicroSD Card Breakout (DF Robot)  >> Link <<

Arduino Code:

#include “DFRobot_GDL.h”
#include <SD.h>
#include <SPI.h>
#include “DFRobot_Picdecoder_SD.h”

DFRobot_Picdecoder_SD decoder;

#define TFT_DC 0
#define TFT_CS 15
#define TFT_RST 2
#define TFT_SD 4

DFRobot_ST7789_240x240_HW_SPI screen(/*dc=*/TFT_DC,/*cs=*/TFT_CS,/*rst=*/TFT_RST);

void setup() {

  //Initialize the serial port
  //Initialize screen
  //Initialize the SD card, wait until the initialization is successful
  #if defined ESP8266
  if (SD.begin(/*sdcs=*/TFT_SD)){

  if (SD.begin(/*sdcs=*/TFT_SD)){
  Serial.println(“initialization done.”);
  Serial.println(“initialization failed!”);

void loop() {

  /* Set the screen color to white */

//For decoding function calling, the function of this function is to draw a pixel on the screen
void screenDrawPixel(int16_t x, int16_t y, uint16_t color) {

  //Draw a point on the screen


Leave a Comment

9 + 1 =