C_cpp_properties.json giving me a hard time!

Hi - would really appreciate it if someone could help me with this. I have the following issue. If I create a new project in PlatformIO everything works fine - all the files are generated, I can build the sketch and I can upload it to the board (I use the blink sketch and edit the interval to check). However, if a now create a second new project - everything the same, except the name - the console shows that c_cpp_properties.json has 5 errors (note: I haven’t touched the file itself). I can build the second project, and upload it without any errors, but nothing changes. I cannot, for example, change the blink speed. Any ideas would be welcome.

Could you share issues from console?

The “errors” are likely from the 5 comment lines in the .json file, which is however not a problem if used by the PlatformIO extension.

That ‘error’ can be safely ignored, it has 0 effect on IntelliSense or thte build. In fact I found that if you open the c_cpp_properties.json file, the parser kicks in and the errors go away. Again, they don’t affect anything else.

1 Like

That’s the weird thing Max - the errors do go away and I can build and upload the sketch just fine, but it doesn’t seem to replace the sketch that’s already on the microcontroller (if, for example, the second sketch uses a blink interval of 500 millis, the LED still blinks at an interval of 1500 millis from the first sketch - it doesn’t seem the change). I wish I knew more!

Hey Ivan - thanks very much for responding. Do you mean a screenshot or something like that?

You need to use the project environment switcher to correctly select your active project. Otherwise you’re stuck with the old one.

1 Like

Max, you are the man!! I can switch via the blue bar at the bottom of the screen which shows either Default (Test_1) or Default (Test_2), and it then does exactly what you’d expect. Many thanks, you are an absolute star!

1 Like