Do I need to use .ino files?

I am new to the embedded development culture. I started with an RP2040 project which had its system using cmake and make. Currently I’m using a “Cheap Yellow Display” which uses the Arduino IDE thus I have various .ino files. I’m switching the PlatformIO and it is working for me. The reason is I want to use Emacs. Emacs spins up an LSP server and it calls ccls which eventually chews through all of the library files but when it gets to the foo.ino file, it vomits because it doesn’t realize that it is a C++ file. From old posts, it appears that it is not easy adding the .ino extension to ccls and the suggestion is just use .cpp. I’m fine either way but just wanted to understand what does the .ino file extension mean to PlatformIO. Can I just not use .ino files if I’m going to use PlatformIO? As a quick test, I changed the foo.ino to foo.cpp and did a build and upload and it seems to work fine.

On a similar note: Does the Arduino IDE consider a .ino file to be C or C++?

.INO files are not valid C / C++ files.

I think the documentation explains very well what you need to do. Please see Convert Arduino file to C++ manually — PlatformIO latest documentation

1 Like