Programming languages for esp-idf (c++)

orbitcoms
Posts: 74
Joined: Fri Aug 03, 2018 10:08 pm

Programming languages for esp-idf (c++)

Postby orbitcoms » Wed May 12, 2021 7:14 am

Can the esp-idf include some of the Arduino libraries?

I have some arduino library functions I want to implement in my project but don't want to figure out how to mimick objects in C to port the code across.

Thanks

ESP_Sprite
Posts: 4765
Joined: Thu Nov 26, 2015 4:08 am

Re: Programming languages for esp-idf (c++)

Postby ESP_Sprite » Thu May 13, 2021 1:42 am

Yes. ESP-IDF supports C++. Additionally, you can add Arduino support as a subcomponent to ESP-IDF; that should allow you to compile any code that you can compile under the Arduino environment for the esp32.

orbitcoms
Posts: 74
Joined: Fri Aug 03, 2018 10:08 pm

Re: Programming languages for esp-idf (c++)

Postby orbitcoms » Thu May 13, 2021 3:30 am

Is there a tutorial for using c++ in esp-idf (vscode)?

ESP_Sprite
Posts: 4765
Joined: Thu Nov 26, 2015 4:08 am

Re: Programming languages for esp-idf (c++)

Postby ESP_Sprite » Thu May 13, 2021 7:24 am

Not sure why one would be needed... just put your code in a .cpp file instead of a .c file and start writing whatever c++ code you require.

orbitcoms
Posts: 74
Joined: Fri Aug 03, 2018 10:08 pm

Re: Programming languages for esp-idf (c++)

Postby orbitcoms » Thu May 13, 2021 7:50 am

I added all the cpp files and header files from an arduino project and it does not compile. There are literally hundreds of errors and warnings.

Then tried to make a new project with "Arduino-as-component" but cannot compile the simple project created as I get error " Failed to resolve component 'arduino_tinyusb'."

Many tutorials explain a stepped method for doing things but they seldom run first time, there are almost always "gotcha's" that end up taking hours to resolve and large learning curves. They seldom explain what to do when it does not work as expected.

Now I am on a venture hunting through Google about this tinyuisb issue but cannot find anything straight forward in plain English. Seems the example builder does not produce a usable project and I now have to learn about cmake issues and command line fiddles to see if I can get this issue resolved before I can move onto the next issue.

Who is online

Users browsing this forum: No registered users and 40 guests