Beetle ESP32-C6使用PWM输出教程出现错误
2024-05-145361
AI 快速预览详细
本文解决了Beetle ESP32-C6在PWM输出时遇到的'ledcSetup'未声明的错误。通过确保包含正确的库文件并检查函数调用,可以轻松修复该问题。PWM输出是一种通过改变脉冲宽度来控制输出信号的技术,类似于调节水龙头的开关大小来控制水流的强弱。
|
Beetle ESP32-C6使用PWM输出教程出现错误 错误描述:error: 'ledcSetup' was not declared in this scope 输出信息: C:\Users\jock\Documents\Arduino\c6\PWM__\PWM__.ino: In function 'void setup()': PWM__:13:3: error: 'ledcSetup' was not declared in this scope 13 | ledcSetup(ledChannel, freq, resolution); | ^~~~~~~~~ PWM__:16:3: error: 'ledcAttachPin' was not declared in this scope; did you mean 'ledcAttach'? 16 | ledcAttachPin(ledPin, ledChannel); | ^~~~~~~~~~~~~ | ledcAttach exit status 1 'ledcSetup' was not declared in this scope 错误截图: 使用教程:https://wiki.dfrobot.com.cn/_SKU ... 2_C6_Basic_Tutorial PWM输出例程 其他设置: ![]() 烦请各位大神指正。 |
-
TueMay-202405148589..png (102.34 KB, 下载次数: 6356)







Github issue里面有人提过相同的问题,你可以参考。
Github issue: https://github.com/espressif/arduino-esp32/issues/9510
乐鑫官方说明: https://docs.espressif.com/projects/arduino-esp32/en/latest/migration_guides/2.x_to_3.0.html#ledc
下面的配图可以参考,如果你上不了Github。
产品经理会后续更新示例代码