Modularizing ESP32 Software
In my ESP32 journey, I’ve come to a point, where I want to be able to split my code into libraries and consume third-party libraries. In this article, I’m going to explore how to do this.
The project directory tree
ESP32 projects follow a folder structure:
1
2
3
4
5
6
7
8
9
10
11
12
project/
├─ components/
│ ├─ component1/
│ │ ├─ CMakeLists.txt
│ │ ├─ ...
│ ├─ component2/
│ ├─ CMakeLists.txt
│ ├─ ...
├─ main/
│ ├─ CMakeLists.txt
│ ├─ ...
├─ CMakeLists.txt