PlatformIO Community

Build and upload .ino files

Hi everyone, I am new in platformio and I play around to become familiar with the platform.

I installed the RTCZero library successfully but when I upload the example sketch on Arduino MKR 1010, it does nothing (but no error is returned). The example file is .ino and I am not sure if this is the problem… What I am doing wrong? Should I make any configurations into the platforio.ini?


ok, just I quick update… I copy paste the sketch into .cpp file and it works fine. So, the problem is the with the .ino files… Is there any way to convert the .ino file included in the libraries’ examples into .cpp files?

I believe the issue is more a fundamental understanding of what is happening. The program that is being uploaded to your Arduino MKR is not the example, but the program located in src/… typically src/main.cpp, which defaults to an empty skeleton program, hence why it does nothing. Just because you have a example like SimpleRTC.ino open in the code editor does not mean that will be compiled and uploaded to the Arduino. If you want to do that, copy the example .ino file in the src/ directory, delete the main.cpp and see if that works as expected. The alternative being to copy the content of the .ino to src/main.cpp, and make the necessary changes to convert an .ino file to a standard C++ source file.

Now I understood what is going on.It works fine, thanks for your help!!

1 Like