Is it possible to change the folder structure of my project? I have a Raspberry Pi which is controlling some Arduinos (1 mega and a few nanos). My ideal folder structure would look something like this:
eurobot2016/
| platformio.ini
| .gitignore
+---src/
| raspberryPiCode.py
+---Arduino/
+---lib/
| +---(Shared code)
+---arduino1/
| +---main.cpp
+---arduino2/
| +---main.cpp
.
.
.
Edit 1: It should be noted that I just started using platformio yesterday (I already love it) and I am using the CLI not the IDE (not sure if that matters here).
- Don’t mix firmware code with Python and etc.
- You need src_filter.
If you want to keep single src
folder between multiple arduinos/nodes, I recommend to use next structure:
eurobot2016
├── firmware
│ ├── lib
│ │ └── readme.txt
│ ├── platformio.ini
│ └── src
│ ├── arduino1
│ │ └── main.cpp
│ └── arduino2
│ └── main.cpp
└── raspberryPiCode.py
The source code of platformio.ini
[env:arduino1]
platform = atmelavr
framework = arduino
board = nanoatmega328
src_filter = +<arduino1>
[env:arduino2]
platform = atmelavr
framework = arduino
board = nanoatmega328
src_filter = +<arduino2>
Then to process specific environment please use pio run -d eurobot2016/firmware -e arduino1
…
Hello again. Thanks for your answer. I will see if I can get that working.
@ivankravets Is there a way I can move platformio.ini into the root of the project with src_dir. I tried src_dir = firmware/src
but that didn’t work.