Visual Studio not recognizing Arduino commands?


#1

I don’t make a living programming, but I’ve been doing it as a hobby for many many years … I got the PlatformIO IDE installed and even successfully compiled and uploaded an empty sketch into my Uno … but when I try to create a more complicated sketch, it seems like the development environment is oblivious to Arduino specific commands … What makes me think that? Well, have a look at this screen shot…

What is it that I need to do to make sure that the IDE is “aware” of Arduino commands? I assume this would also enable code completion etc. etc. I’m using MacOS if that matters…

Thank you,

Mike Sims


#2

Do you have the Arudino.h included? Have you tried to rebuild the IntelliSense index by pushing ctrl+shift+p in VSCode and then type PlatformIO: Rebuild IntelliSense Index?


#3

Had that problem too at first - as said: always include Arduino.h on top.
Or just have POI generate a new project, then paste main.cpp after said first include.


#4

No, I have not tried that but I didn’t know about it either … I did actually remove the entire visual studio app and all plugins then I removed all CLI PlatformIO so that I could start clean and when I re-installed everything, the intellisense seems to be working even if I leave the file as an .INO file. So far so good … of course I’ll check back if I have any other issue but for the moment, I’ve got everything working pretty smoothly.

It’s nice to have code completion and a more “mature” development environment with an Arduino sketch … it kind of brings the whole experience out of grade school and into college … so to speak… :slight_smile:


#5

I like the idea of generating a new project then copying things over instead of importing … thanks for the heads up on that!

Mike


#6

Makes sense with something as complex as POI - all the folders are in place, you get your .git files and the .ini is already pre-configured for basic use.