ESP32S3-Cam实践(LedStrip、RC舵机控制)

0.参考

以ESP Component espressif/led_strip组件的example为工程进行实践。

1.挂载LedStrip

确定连接的引脚,确定不使用DMA,确定灯珠个数

cpp 复制代码
// Set to 1 to use DMA for driving the LED strip, 0 otherwise
// Please note the RMT DMA feature is only available on chips e.g. ESP32-S3/P4
#define LED_STRIP_USE_DMA  0

#if LED_STRIP_USE_DMA==1

// Numbers of the LED in the strip
#define LED_STRIP_LED_COUNT 256
#define LED_STRIP_MEMORY_BLOCK_WORDS 1024 // this determines the DMA block size

#elif LED_STRIP_USE_DMA==0

// Numbers of the LED in the strip
#define LED_STRIP_LED_COUNT 35
#define LED_STRIP_MEMORY_BLOCK_WORDS 0 // let the driver choose a proper memory block size automatically

#endif // LED_STRIP_USE_DMA

// GPIO assignment
#define LED_STRIP_GPIO_PIN  3

2.Build,Flash and Monitor

监视器输出,GoodGood

bash 复制代码
I (256) main_task: Started on CPU0
I (266) main_task: Calling app_main()
I (266) example: Created LED strip object with RMT backend
I (266) example: Start blinking LED strip
I (276) example: LED OFF!
I (776) example: LED ON!
I (1276) example: LED OFF!

0.参考

以ESP-IDF v5.5.0的MCPWM RC Servo Control Example进行实践。

1.挂载SG90

确定舵机信号线连接的引脚与示例程序中一致。

cpp 复制代码
#define SERVO_PULSE_GPIO  8  // GPIO connects to the PWM signal line

2.Build,Flash and Monitor

监视器输出,GoodGood

bash 复制代码
I (252) main_task: Started on CPU0
I (262) main_task: Calling app_main()
I (262) example: Create timer and operator
I (262) example: Connect timer and operator
I (262) example: Create comparator and generator from the operator
I (272) example: Set generator action on timer and compare event
I (282) example: Enable and start timer
I (282) example: Angle of rotation: 0
I (782) example: Angle of rotation: 2
I (1282) example: Angle of rotation: 4
相关推荐
码农42715 分钟前
点评项目深入改造-------日常学习笔记
java·笔记·学习·搜索引擎·全文检索
测试_AI_一辰35 分钟前
Agent & RAG 测试工程笔记 13:RAG检索层原理拆解:从“看不懂”到手算召回过程
人工智能·笔记·功能测试·算法·ai·ai编程
云边散步1 小时前
godot2D游戏教程系列二(19)
笔记·学习·游戏·游戏开发
sheeta19981 小时前
LeetCode 每日一题笔记 日期:2025.03.22 题目:1886.判断矩阵经轮转后是否一致
笔记·leetcode·矩阵
sonnet-10291 小时前
拓扑排序的实现
java·c语言·开发语言·笔记·算法
不想看见4041 小时前
Min Stack栈和队列--力扣101算法题解笔记
java·笔记·leetcode
马猴烧酒.1 小时前
【面试八股|计算机网络】计算机网络常见面试题详解笔记
java·开发语言·网络·笔记·计算机网络·算法·面试
学机械的鱼鱼1 小时前
【学习笔记】如何快速理解ROS2
笔记·学习
诸神缄默不语1 小时前
论文阅读笔记:AI编程用的AGENTS.md应该不写或少写
论文阅读·笔记·ai编程
Yu_Lijing1 小时前
基于C++的《Head First设计模式》笔记——蝇量模式
c++·笔记·设计模式