[General Discussion, Idea, Platformio improvement, Mass adaptation]
Dear Platformio Community.
First of all it is great a pleasure for me to finally join in this illustrious community. I have found out about Platformio project on January of this year and ever since have been using it for many of my arduino projects. I use the Atom Text editor which I found to be extremely easy and intuitive to learn and use.
A bit about myself, I am a mechanical engineer from Bangladesh with a passion for robotics and have been using arduino development platform for the past 4 years. I have adequate knowledge in Embedded C but donât have a lot of experience with C++ or Python.
As great as platformio is, you are all aware of the fact that platformio does not compile multiple cpp files in the same way as arduino concatenates multiple ino files. To illustrate my point,
When I write codes in Arduino IDE, I can split the function bodies from the main ino files into discrete files following a sequential alphabetical naming scheme viz. A.main , B.pid, C.motor etc etc. When I hit the compile button, arduino compiles all these files and their associated header files without any error. Also the other ino files are capable of recognizing public variables, function calls written in libraries by other users installed into the Arduino IDE.
But in platformio, say I make the above files as such, main.cpp, pid.cpp, motor.cpp numerous errors are thrown including missing variable declarations from other libraries, for instance tft declaration of Adafruit GFX library is not recognized in other cpp files EXPECT in the main.cpp file.
Thus every time the project gets complex I am forced to use Arduino IDE in spite of the robustness and ease of coding platformio provides for its users.
Hence though I am not an expert in this subject matter, I strongly believe the platformio community/team should make ONE DEFINITIVE TUTORIAL to teach us less experienced programmers on how to create a multifile arduino project which will do the following
** Split the function bodies into multiple files
** The cpp files, other than main.cpp, will be able to recognize functions installed in external libraries in platformio.
** The tutorial will be comprehensive enough to teach the basics of object oriented programming and will be less ambiguity or and not be too complex to follow.
** The files should be such that if the main.cpp is imported as a project in Arduino, say new_project.ino into Arduino Ide, then that Ide will have no problem in recompiling them
This is the best paraphrasing I could come up with for the above ideas with my limited programming knowledge.
Thank you all for reading this long post and any help/ tips and tricks will be most appreciated.
With regards
Azmyin