visual Code ESP32开发
## visual Code ESP32开发 安装vs code插件: - Espressif IDF:提供模板向导,构建,烧录,监控,调试等功能 - ms-vscode.cpptools: c/c++语义分析,IntelliSense 与跳转 - ms-python.python:IDF内部脚本依赖python 自动安装esp-idf工具链: 第一次启动插件 → 左侧 “IDF” 图标 → 运行 ESP-IDF: Config
## visual Code ESP32开发 安装vs code插件: - Espressif IDF:提供模板向导,构建,烧录,监控,调试等功能 - ms-vscode.cpptools: c/c++语义分析,IntelliSense 与跳转 - ms-python.python:IDF内部脚本依赖python 自动安装esp-idf工具链: 第一次启动插件 → 左侧 “IDF” 图标 → 运行 ESP-IDF: Config
## c++开发环境 ## ubuntu开发环境 `sudo apt update && sudo apt install -y build-essential cmake ninja-build gdb` 安装编译三件套 vscode wsl中安装插件 `C/C++` `CMake Tools` 创建工程说明: CMakeLists.txt ``` cmake_minimum_required(VERSION 3.20)
## ROS2开发 文档:https://docs.ros.org/en/foxy/index.html 中文文档:http://dev.ros2.fishros.com/doc/ ubuntu从源安装教程https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html#resources ### 安装ros2 `sudo apt update && sudo
## .h编写 ## 通用.h ```h #ifndef MYLIB_H // ① 头文件保护,防重复包含 #define MYLIB_H /* ② 版本与可见性控制(跨平台导出/导入符号) */ #if defined(_WIN32) || defined(__CYGWIN__) #ifdef MYLIB_BUILD // 编库时在编译选项里定义 MYLIB_BUILD #define
## ESP-IDF + arduino组件开发 ESP32 Arduino文档:https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32/api-guides/tools/idf-component-manager.html ## 开发环境 Arduino组件目前仅支持到5.5版本(5.5.x不行) 在idf终端执行`idf.py add-dependency "
## ESP-IDF基础 项目地址:https://github.com/espressif/esp-idf.git 文档:https://docs.espressif.com/projects/esp-idf/zh_CN/release-v5.5/esp32s3/get-started/index.html (左上角选择硬件和版本) 安装VS code扩展:ESP-IDF,c++(cursor安装vsix版)、CMake Tools
## c++基础 helloworld.cpp: ```c++ #include <iostream> // 引入输入输出库 #include <string> // 引入字符串库 #include <cmath> // 引入数学库 #include <fstream> // 引入文件读写库 using namespace std; // 使用std命名空间,这样就不用每次都写成std::cout // using std:
## ESP-IDF代码片段 开关按一下亮起,然后再按 一下关闭,消抖 ```c++ #include "Arduino.h" int LED_PIN = 1; // LED灯引脚 int BUTTON_PIN = 4; // 按钮引脚 // 运行态变量 bool g_ledOn = false; // LED 当前状态(false=灭,true=亮) int g_lastStableBtn
## ESP单片机硬件 ## 开发板 flash工具: https://docs.espressif.com/projects/esp-test-tools/zh_CN/latest/esp32/production_stage/tools/flash_download_tool.html esp32s3 lde灯: 红色 电源等 蓝色 串口灯 https://docs.espressif.com/projects/esp