# ESP32CWKeySim **Repository Path**: techcave/esp32-cwkey-sim ## Basic Information - **Project Name**: ESP32CWKeySim - **Description**: 一个用 ESP32 做的莫尔斯码练习器。 - **Primary Language**: C++ - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 4 - **Forks**: 1 - **Created**: 2021-12-20 - **Last Updated**: 2024-08-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ESP32CWKeySim # 介绍 一个用 ESP32 做的莫尔斯码练习器。 # 软件基础 Arduino、ESP32、LVGL、TFT_eSPI、BleKeyboard(https://github.com/T-vK/ESP32-BLE-Keyboard) # Pin Map |部件名称|ESP32引脚|部件功能引脚|I2C|下图对应|说明| |:----|:----|:----|:----|:----|:----| |TFT|19|TFT_MISO| | |输入可能是触屏| | |23|TFT_MOSI|SDA|SPI2_MOSI|数据线| | |18|TFT_SCLK|SCL|SPI2_SCK|时序线| | |5|TFT_CS|CS|SPI2_CS|片选| | |2|TFT_DC|DC|PA12|数据命令选择线| | |4|TFT_RST|RST|SPI2_MISO|复位| |Encoder|25|A| | | | | |26|B| | | | | |27|Button| | | | |Buzzer|14|Buzzer| | | | |CW KyEy|12|Left| | | | | |13|Right| | | | # 环境搭建 ## lv_conf.h ``` // Open lv_conf.h and change the first #if 0 to #if 1 #if 1 // 添加 #define LV_HOR_RES_MAX (160) #define LV_VER_RES_MAX (128) // 根据屏幕 /*Color depth: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888)*/ #define LV_COLOR_DEPTH 16 // Set LV_TICK_CUSTOM 1 #define LV_TICK_CUSTOM 1 ``` ## User_Select_Setup.h ``` 注释掉 #include // #include 取消注释 #include #include ``` ## Setup43_ST7735.h ``` #define TFT_WIDTH 160 #define TFT_HEIGHT 128 #define ST7735_GREENTAB128x160 #ifdef ESP32 #define TFT_MISO 19 #define TFT_MOSI 23 #define TFT_SCLK 18 #define TFT_CS 5 // Chip select control pin #define TFT_DC 2 // Data Command control pin #define TFT_RST 4 // Reset pin (could connect to RST pin) ``` ## 在 Arduino 中安装 ESP32 开发板支持 https://github.com/arduino/Arduino/wiki/Unofficial-list-of-3rd-party-boards-support-urls https://dl.espressif.com/dl/package_esp32_index.json # 支持这个项目 ![3D 打印自动键](./assets/咸鱼.jpg) # 参考资料 https://www.oreilly.com/openbook/make3/book/index.csp