2311| 3
|
[求助问答] Beetle ESP32-C6使用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输出例程 其他设置: 烦请各位大神指正。 |
ESP32-C6使用的是乐鑫官方推出的Arduino SDK,而且C6只能用3.0.0以上的版本。这个版本里面PWM的函数发生了变化。 Github issue里面有人提过相同的问题,你可以参考。 Github issue: https://github.com/espressif/arduino-esp32/issues/9510 乐鑫官方说明: https://docs.espressif.com/proje ... .x_to_3.0.html#ledc 下面的配图可以参考,如果你上不了Github。 产品经理会后续更新示例代码 |
YeezB 发表于 2024-5-15 10:37 谢谢大佬,wiki百科中还是原来的代码,入坑了,网址https://wiki.dfrobot.com.cn/_SKU ... d_ESP32_C6#target_7 |
© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed