Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/mlewand/arduino-source-separation
- Owner: mlewand
- Created: 2017-09-09T22:14:58.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-09T22:15:12.000Z (over 7 years ago)
- Last Synced: 2024-11-24T11:25:23.626Z (2 months ago)
- Language: C++
- Size: 8.79 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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**. 👌