I have a project developed in Arduino IDE that compiles and runs perfectly on the Arduino IDE. It has the main file with the same name as the Arduino project + one .h file and 5 other ino files. It is done this way to better organise code in the Arduino IDE.
I have imported this project into platformio which I would really like use for my future project development to the extend of purchasing a subscription. I changed the main file name to main.ino. I placed all the function declarations in the main file and I have tried putting the declarations both before the includes, after the includes and tried adding the extern word in front of the declaration. At the moment the declarations are before the includes preceded with the word extern. The code builds with “Success” and the code loads onto the Wemos board and runs.
However my problem is that in all five .ino files apart from the main and .h files I get loads of red squiggles, which when highlighted show not ‘undefined’ . They are obviously defined in the definitions file because otherwise the code would not compile.
I have spent over a day trying to solve this issue, could someone please tell me how to get rid of the ‘problems’?
I have set the paths to Arduino and my libraries.
Can’t reproduce this without having the project files. Can you zip them?
What IDE are you using? VSCode?
First line of defence would be to reload the project files, there’s a PIO target for that. Or just call pio init --ide=vscode
(or whatever IDE you have) in your project’s folder.
Yes, I’ll zip them later and send them. I am using VS code. Do you mean zip the pio files or the original Arduino files?
The PIO project that’s giving you errors.
I’ve zipped the project folder, how do I upload the .zip file, sorry for being dumb I am very new to this type of issue
Dropbox, Google Drive, or PM me for an email.
I have sent the zip in the reply to the email that came to me in Outlook. Hope that’s ok
That doesn’t work. That’s a no-reply mail, most surely. Look into your PMs.
You are right, didn’t notice noreply. Sent to your PM now so you should get them this time.
I have tried reloading the project files, that made no difference!
I had set the Arduino path incorrectly, I have now fixed that, no difference.
I have uninstalled ‘clang’ which in another post from Ivan he said the ‘clang’ add in wasn’t with VSC. That made no difference either so it looks like there is a significant bug in importing Arduino code or in the use of multiple .ino files within the project.
Any suggestions as to how to proceed to a successful conclusion to the issues encountered would be gratefully received.