Giter VIP home page Giter VIP logo

esp-idf-m5stickc's Introduction

esp-idf-m5stickC

Example code for driving M5StickC ST7735S display using ESP-IDF's SPI driver.

M5StickC-2

Software requirements

esp-idf v4.4/v5.x.

How to build

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

*There is no MENU ITEM where this application is peculiar.

You need to specify Baud rate for flashing.

Graphic support

M5StickC-3

M5StickC-4

M5StickC-5

M5StickC-8

Fonts support

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

M5StickC-7

It's possible to indicate more than one font at the same time.
Gothic Font.
M5StickC-9

Mincyo Font.
M5StickC-10

Font File

This project uses the following as default fonts:

  • font/ILGH16XB.FNT // 8x16Dot Gothic
  • font/ILGH24XB.FNT // 12x24Dot Gothic
  • font/ILGH32XB.FNT // 16x32Dot Gothic
  • font/ILMH16XB.FNT // 8x16Dot Mincyo
  • font/ILMH24XB.FNT // 12x24Dot Mincyo
  • font/ILMH32XB.FNT // 16x32Dot Mincyo

From 0x00 to 0x7f, the characters image of Alphanumeric are stored.
From 0x80 to 0xff, the characters image of Japanese are stored.
Changing this file will change the font.

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.
When you build the firmware, the font files are uploaded to the SPIFFS partition.

Please refer this page about FONTX format.

Font File Editor(FONTX Editor)

There is a font file editor.
This can be done on Windows 10.
Developer page is here.

fontx-editor-1

Convert from TTF font to FONTX font

step1)
Download WFONTX64.exe from here. Developer page is here.

step2)
Select ttf font.
Please note that if you select a proportional font, some fonts may not convert correctly.
If you select a proportional font, some fonts will need to be modified using fontxedit.exe.
Monospaced fonts can be converted correctly.
WFONTX64-1

step3)
Enter Height, Width, FontX2 name.
Specify half of Height for Width.
Specify your favorite font name in the FontX2 name field using up to 8 characters.
WFONTX64-2

step4)
Specify the file name to save.
WFONTX64-3

step5)
Specify the font style as required.
WFONTX64-4

step6)
Press the RUN button to convert TTF fonts to FONTX format.
WFONTX64-5

step7)
upload your font file to $HOME/esp-idf-m5stickC/font directory.

step8)
add font to use

    FontxFile fx16[2];
    FontxFile fx24[2];
    FontxFile fx32[2];
    //InitFontx(fx16,"/spiffs/ILGH16XB.FNT",""); // 8x16Dot Gothic
    //InitFontx(fx24,"/spiffs/ILGH24XB.FNT",""); // 12x24Dot Gothic
    //InitFontx(fx32,"/spiffs/ILGH32XB.FNT",""); // 16x32Dot Gothic

    //InitFontx(fx16,"/spiffs/ILMH16XB.FNT",""); // 8x16Dot Mincyo
    //InitFontx(fx24,"/spiffs/ILMH24XB.FNT",""); // 12x24Dot Mincyo
    //InitFontx(fx32,"/spiffs/ILMH32XB.FNT",""); // 16x32Dot Mincyo

    InitFontx(fx16,"/spiffs/Gigi16.FNT",""); // 8x16Dot Gigi
    InitFontx(fx24,"/spiffs/Gigi24.FNT",""); // 12x24Dot Gigi
    InitFontx(fx32,"/spiffs/Gigi32.FNT",""); // 16x32Dot Gigi

TTF_FONT

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-Plus

esp-idf-m5stickc's People

Contributors

nopnop2002 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

esp-idf-m5stickc's Issues

Multiple decode errors occured: Try checking the baud rate and XTAL frequency setting in menuconfig

Multiple decode errors occured: Try checking the baud rate and XTAL frequency setting in menuconfig
�k�E���0x00,\E���0x00,dߖ��0��,cs�E����0,h�E���0�0,wpߖ��0��
moV�"%=� cloc�"���2C!녑�0x3ff�30,���70�j
ho�╗tail�2 ro�
�j
Multiple decode errors occured: Try checking the baud rate and XTAL frequency setting in menuconfig
�+��0�����,len�����j
ho 0������&�����4
Multiple decode errors occured: Try checking the baud rate and XTAL frequency setting in menuconfig
�Y���0x4008�4c

Hello, how do I configure my ST7735S screen to eliminate this warning

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.