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
相关推荐
峥无4 小时前
从0到1手撕红黑树:封装实现 my_map 与 my_set(SGI-STL 源码级深度解析)
开发语言·c++·笔记·算法·stl
不会代码的小猴5 小时前
3. 控件学习1
开发语言·c++·笔记·qt·算法
疯狂打码的少年6 小时前
【数据结构】图的存储结构:邻接矩阵与邻接表
数据结构·笔记
蒸蒸yyyyzwd7 小时前
cpp 选手准备秋招学习笔记 day10
笔记·面试·求职招聘
haerapicom8 小时前
欠定方程里藏着哪几个非零项:OMP 稀疏恢复侦探笔记
笔记
程思扬8 小时前
Android ANR实战排查:主线程SystemClock.sleep导致页面启动偶现无响应
android·笔记
zjnlswd9 小时前
C#学习笔记4
笔记·学习·c#
青山是哪个青山10 小时前
LangChain 学习笔记(九):上下文与记忆
笔记·学习·langchain
Z59981784111 小时前
c#软件开发学习笔记--Modbus-TCP/UDP网口通讯
笔记·学习·c#
阿里巴巴首席技术官13 小时前
目标检测基础
笔记·yolo