Change folder structure

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:

|	platformio.ini
|	.gitignore
		|	+---(Shared code)
		|	+---main.cpp
		|	+---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).

  1. Don’t mix firmware code with Python and etc.
  2. You need src_filter.

If you want to keep single src folder between multiple arduinos/nodes, I recommend to use next structure:

├── firmware
│   ├── lib
│   │   └── readme.txt
│   ├── platformio.ini
│   └── src
│       ├── arduino1
│       │   └── main.cpp
│       └── arduino2
│           └── main.cpp

The source code of platformio.ini

platform = atmelavr
framework = arduino
board = nanoatmega328
src_filter = +<arduino1>

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.