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

0.参考

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

1.挂载LedStrip

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

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

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

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

#define SERVO_PULSE_GPIO  8  // GPIO connects to the PWM signal line

2.Build,Flash and Monitor

监视器输出,GoodGood

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值