1

I worked through the steps at https://www.jetbrains.com/help/clion/platformio.html to get PlatformIO installed and working with CLion. The following program now works:

void setup() {
    Serial.begin(9600);
    Serial.println("yay, I'm working.");
}

void loop() {
}

Now... I need to get an ESP32-compatible SSD1306 library installed (among others), so I can actually do something useful.

As far as I can tell, CLion (with or without the PlatformIO plugin) has nothing like the library browser in the Arduino IDE. Is there a less barbaric way of getting Arduino libraries into a CLion-PlatformIO project than grabbing the library's repo from Github and hand-copying files (and their recursive dependencies)?

Are PlatformIO projects created via CLion round-trip compatible with VSCode+PlatformIO? Like, can I create the PlatformIO project in CLion, exit CLion, launch VSCode, open the same project, use VSCode to add the libraries, exit VSCode, then go back into CLion and use them? Or is that a recipe for pain, tears, and corrupt config files?

Bitbang3r
  • 6,826
  • 5
  • 27
  • 40
  • What is the question? you can't use [platformio.ini](https://docs.platformio.org/en/latest/projectconf/) to config your project or adding library dependencies via [lib_deps](https://docs.platformio.org/en/latest/projectconf/section_env_library.html?highlight=lib_deps)? – hcheung Dec 18 '21 at 09:50
  • It appears to work, but as noted, I don't know enough about how PlatformIO integrates with CLion and VSCode to know whether it's SAFE, or whether VSCode might do something behind CLion's back that CLion will eventually notice & get upset about. Kind of like how, years ago, Netbeans & Eclipse claimed they could theoretically round-trip edit each other's Ant-based projects (so members of a team could theoretically use whichever IDE they preferred on a shared project)... but it never quite worked reliably. Eventually, Eclipse or Netbeans would do something the other didn't like, and... boom. – Bitbang3r Dec 18 '21 at 21:43

1 Answers1

1

As far as I can tell, CLion (with or without the PlatformIO plugin) has nothing like the library browser in the Arduino IDE. Is there a less barbaric way of getting Arduino libraries into a CLion-PlatformIO project than grabbing the library's repo from Github and hand-copying files (and their recursive dependencies)?

Using PlatformIO, you just need to add the library name into platformio.ini file. PlatformIO provides PlatformIO Home to help you with searching and adding library into platformio.ini file. Run pio home in the your terminal. If your setup is correct you will be able to run the command and access the web app.

For your reference:

Home page PlatformIO Local Web homepage

Library Browser enter image description here

Adding library to your project enter image description here

platformio.ini

enter image description here

Are PlatformIO projects created via CLion round-trip compatible with VSCode+PlatformIO? Like, can I create the PlatformIO project in CLion, exit CLion, launch VSCode, open the same project, use VSCode to add the libraries, exit VSCode, then go back into CLion and use them? Or is that a recipe for pain, tears, and corrupt config files?

Yes. You can open it from both IDE. You can view more in their docs

Geral
  • 56
  • 1
  • 1
  • 6