Example Code for Arduino-Character Display

This article provides code for displaying characters using an ESP32 microcontroller in conjunction with the FireBeetle Expansion Board - ePaper Display Module.

Hardware Preparation

  • ESP32 x1
  • FireBeetle Covers-ePaper Black&White&Red Display Module x1

Software Preparation

Compatible with Arduino IDE + DFRobot_Display Library + DFRobot_ePaper Library

Wiring Diagram

Select D3 and D6 of dial switch(D3 is the Ink Screen CS pin and D6 is the Font Library CS pin), and then plug the FireBeetle Cover-ePaper Display Module into the esp32.

Sample Code

#include "Arduino.h"
#include "DFRobot_IL0376F_SPI.h"
DFRobot_IL0376F_SPI eink;

#define EINK_CS  D3
#define Font_CS  D6
#define EINK_DC  D8
#define BUSY     D7

void setup(void)
{
    Serial.begin(115200);
    //Select the corresponding pins
    eink.begin(EINK_CS, Font_CS, EINK_DC, BUSY);

    //Clear the screen and display white
    eink.fillScreen(WHITE);
    //Displays a string, red font
    eink.disString(12,12,1,"DFRobot EINK 1234567890,!@#$%^&*()-+=",RED);
    //Refresh screen display
    eink.flush();
    delay(3000);

    //Displays a string, red font
    eink.disString(12,48,1,"DFRobotThree-color electronic ink screen test program",BLACK);
    //Refresh screen display
    eink.flush();
}

void loop(void)
{
    delay(8000);
}

Result

The screen will display red and black strings as described in the code. Chinese characters (if included in the string) will be shown in 16x16 lattice, and ASCII characters in 16x8 lattice.

DFR0531_epaper-display-module

Additional Information

  • Currently, only simplified Chinese (16x16) and ASCII (16x8) are supported; more fonts will be added in future library updates.
  • The disString function takes (x,y) coordinates, font size (1 for 16x16), string, and color as parameters.

Was this article helpful?

TOP