Seeking Mac/Unix, CLion, C Language guides/tutorials

khervey
Posts: 3
Joined: Sun Aug 18, 2024 1:56 am

Seeking Mac/Unix, CLion, C Language guides/tutorials

Postby khervey » Wed Sep 25, 2024 9:31 pm

I have plenty of Java/Maven/IntelliJ experience for enterprise software, but recently started with C language/CMake/Clion on Unix/Mac for embedded software on microcontrollers, specifically Espressif ESP32.

I have made a few working projects that do minor things such as varying blink rate on an ESP32, but need to go deeper.

I will take general advice (having looked at CLion page and the Esspressif page: https://docs.espressif.com/projects/esp ... clion.html and https://www.jetbrains.com/help/clion/esp-idf.html) on getting up to speed.

But my struggles seem to focus around transitioning Maven build tool for Java to CMake build tool for C language. Especially for adding headers/libraries.

For example, I would like to get the OLED Adafruit SSD1306 in my kit to work. I only have the code and instructions for use with the Aruduino IDE which I have not used and hope not to. Seems to require downloading some libraries and telling CLion somehow to use them and get the CMake to work. The sample code starts off:

Code: Select all

#include <Adafruit_GFX.h>

#include <Adafruit_SSD1306.h>

// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)

#include <Wire.h>

#define SCREEN_HEIGHT 64 // OLED display height, in pixels

#define SCREEN_WIDTH 128 // OLED display width, in pixels

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
Any help is appreciated.

Kent Hervey
You can find me on LinkedIn and elsewhere as "Kent Hervey"

MicroController
Posts: 1729
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Seeking Mac/Unix, CLion, C Language guides/tutorials

Postby MicroController » Thu Sep 26, 2024 6:24 pm

Coming from a Java background, I suggest also looking into using C++.

ESP-IDF Cmake is similar to Maven in that you declare dependencies to other "components" in your CMakeLists.txt which will then be pulled in to your build/application.

In addition, you can use the IDF component manager which can even automatically download required components from a central repository (ESP component registry).

Using Arduino code/libraries usually requires the whole Arduino framework to be present, which IMHO doesn't blend in well with otherwise non-Arduino applications.

For the SSD1306 there are multiple drivers/libraries available which can be used with the IDF and without the Arduino framework, e.g. this one.

khervey
Posts: 3
Joined: Sun Aug 18, 2024 1:56 am

Re: Seeking Mac/Unix, CLion, C Language guides/tutorials

Postby khervey » Thu Sep 26, 2024 8:46 pm

Microcontroller,

Thanks much.

I will do some Googling/Studying on
--CMake in general and CMake with CLion
--IDF Component Manager... such as: https://docs.espressif.com/projects/esp ... nager.html
--The link you sent: https://github.com/nopnop2002/esp-idf-ssd1306

I am happy to receive other links and tips and suggestions
You can find me on LinkedIn and elsewhere as "Kent Hervey"

Who is online

Users browsing this forum: No registered users and 65 guests