Skip to content

[Question] Is there a way to specify a file to upload when there are multiple .ino files in directory? #5021

@ryanlinjui

Description

@ryanlinjui

What kind of issue is this?

  • Question.
    This issue tracker is not the place for questions. If you want to ask how to do something,
    or to understand why something isn't working the way you expect it to,
    use Community Forums or Premium Support

Configuration

Operating system: macOS Sonoma Version 14.2

PlatformIO Version (platformio --version): PlatformIO Core, version 6.1.16

Description of problem

Here's my directory structure:

arduino
├── platformio.ini
├── arm_atmega1280.ino
├── receiver_esp8266.ino
├── remote_esp8266.ino
└── servo_debug.ino

I'm wondering if there's a way to specify the environment to run a different file?
Or can I specify a file to compile and upload?

By the way, this is for my project darkchess-robot. Thanks for your help!

Steps to Reproduce

  1. cd to arduino directory
  2. Run pio run -e remote, then it prints error message.
  3. Run pio run -e receiver, then it also prints error message.

Actual Results

Error message by step 2:

Error: Nothing to build. Please put your source code files to the '/my/workspace/dir/arduino' folder.

Error message by step 3:

Error: Nothing to build. Please put your source code files to the '/my/workspace/dir/arduino' folder

Expected Results

Successfully compile and upload to board.

If problems with PlatformIO Build System:

The content of platformio.ini:

[platformio]
src_dir = .

[env:remote]
platform = espressif8266
board = esp07
framework = arduino
src_filter = +<remote_esp8266.ino>

[env:receiver]
platform = espressif8266
board = esp07
framework = arduino
src_filter = +<receiver_esp8266.ino>

[env:arm]
platform = atmelavr
board = ATmega1280
framework = arduino
src_filter = +<arm_atmega1280.ino>

[env:debug]
platform = atmelavr
board = ATmega1280
framework = arduino
src_filter = +<servo_debug.ino>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions