Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mlewand/arduino-source-separation

An example Arduino directory where source files are split into multiple files.
https://github.com/mlewand/arduino-source-separation

Last synced: 1 day ago
JSON representation

An example Arduino directory where source files are split into multiple files.

Awesome Lists containing this project

README

        

# Arduino Source Separation

This is an example how to split your logic into a `.h` and `.cpp` files in subdirectories, and how to include them to your `.ino` file. This will help you to keep your code more organized. 🗃

## Reason

I faced some funny compilation (linking) errors, despite having a correct file structure. Errors like:

```
sketch\testFileSeparation.ino.cpp.o:(.text.setup+0xc): undefined reference to `Dummy::Dummy()'

sketch\testFileSeparation.ino.cpp.o: In function `HardwareSerial::begin(unsigned long)':
```

As it turned out in one Arduino IDE versions there was a change that only `src/*` subdirectories are scanned for `.cpp` files. There was [a live-saving post on Arduino forums](https://forum.arduino.cc/index.php?topic=445230.msg3064170#msg3064170) that nailed the issue, so big thanks to **pert**. 👌