Skip to content

nopnop2002/esp-idf-m5stickC-Plus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

esp-idf-m5stickC-Plus

Example code for driving M5StickC-Plus/Plus2 ST7789V2 display using ESP-IDF's SPI driver.

M5StickC-Plus2

Software requirements

esp-idf v4.4/v5.x.

Installation

git clone https://github.com/nopnop2002/esp-idf-m5stickC-Plus
cd esp-idf-m5stickC-Plus/screen
idf.py set-target esp32
idf.py menuconfig
idf.py flash -b 115200 monitor

You need to specify Baud rate for flashing.

Configuration

config-top config-app-1 config-app-2

Graphic support

M5StickC-Plus-2

M5StickC-Plus-3

M5StickC-Plus-4

Fonts support

It's possible to text rotation and invert.
M5StickC-Plus-5

M5StickC-Plus-6

M5StickC-Plus-7

It's possible to indicate more than one font at the same time.
M5StickC-Plus-11

Image support

BMP file
M5StickC-Plus-8 JPEG file
M5StickC-Plus-9 PNG file
M5StickC-Plus-10

Font File

You can add your original font file.
The format of the font file is the FONTX format.
Your font file is put in font directory.
Your font file is uploaded to SPIFFS partition using meke flash.

Please refer this page about FONTX format.

FontxFile yourFont[2];
InitFontx(yourFont,"/spiffs/your_font_file_name","");
uint8_t ascii[10];
strcpy((char *)ascii, "MyFont");
lcdDrawString(dev, yourFont, x, y, ascii, color);

How to add your color

Change here.

#define RED    rgb565(255,   0,   0) // 0xf800
#define GREEN  rgb565(  0, 255,   0) // 0x07e0
#define BLUE   rgb565(  0,   0, 255) // 0x001f
#define BLACK  rgb565(  0,   0,   0) // 0x0000
#define WHITE  rgb565(255, 255, 255) // 0xffff
#define GRAY   rgb565(128, 128, 128) // 0x8410
#define YELLOW rgb565(255, 255,   0) // 0xFFE0
#define CYAN   rgb565(  0, 156, 209) // 0x04FA
#define PURPLE rgb565(128,   0, 128) // 0x8010

Reference

https://github.com/nopnop2002/esp-idf-m5stickC

Releases

No releases published

Packages

No packages published

Languages