在 ESP-IDF 中使用 Arduino 的第三方库
本文最后更新于278 天前,其中的信息可能已经过时,如有错误请发送邮件到cishaxiatian@gmail.com

首先需要去找到对应IDF版本的Arduino版本,我自己是IDF5.5.1,这里下载的是

espressif/arduino-esp32: Arduino core for the ESP32

0

将 arduino-esp32 库作为工程的组件来使用

1.创建一个新的工程,这里使用IDF中的hello_world的示例

1

2.将main文件夹下的 hello_world_main.c 重命名为c++文件, hello_world_main.cc ,并将mian文件下的cmakelists.txt中的内容修改如下

2

3.将hello_world_main.cc代码修改如下

#include "Arduino.h"

extern "C" void app_main()
{
  initArduino();

  // Arduino-like setup()
  Serial.begin(115200);
  while(!Serial){
    ; // wait for serial port to connect
  }

  // Arduino-like loop()
  while(true){
    Serial.println("loop");
    delay(1000);
  }

4.CONFIG_FREERTOS_HZ=100修改为1000

4

5.编译烧录即可

5

完整项目链接

通过网盘分享的文件:IDF_Use_Arduino_Library.zip 链接: https://pan.baidu.com/s/19S8f-10_Vqg24cYb1L_bPw?pwd=j2wt 提取码: j2wt –来自百度网盘超级会员v4的分享

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇