New to C++ and Arduino, issues with code

Good evening, I am new to C++ and Arduino. I cobbled together code for the MKR_ENV and the AtlasTentacle boards from examples online. I am using the Arduino web editor and Visual Studio Code to try to find errors. In Visual Studio Code, the IDE shows 153 separate problems with the code. However, when I put the code into Arduino IDE, there are no errors shown. I'm unsure if this is my lack of familiarity with C++ or if there are actually 153 errors present. I really think I just need to walk through the code line by line with someone who has a trained eye for issues with Arduino and C++.

This is a project for school (due on Dec. 1st). I would truly appreciate any troubleshooting guidance in resolving these errors. Thank you in advance for taking the time to read and respond.


although a big fan of Visual Studio for c#, I did not try to use VS Code for Arduino programming. I'm wondering if you installed all user libraries and hardware libraries as well (what device are you using?)

Dummy question: why don't you work with Arduino IDE if it works???


It's difficult to help with code you can't see.

But if your code compiles error-free in the IDE then I can't see any real problem. Use it from there and get testing to see if you have any real problems.


Good Evening,
I’m not sure the Arduino IDE is pulling in all of the libraries. I’ve been tinkering with that this evening and when I click on verify and save, the ESPmDNS and Webserver libraries show a “Not found” message.

I will attach the code here.

ServerCode.txt (14.1 KB)

What if you use quotes in your #include instead?

include "ESPmDNS.h"

include "WebServer.h"

I think these libraries are part of boards libraries: What device are you using and for which device the example was designed for?

I'm using a MegaDue with an MKR_ENV and an Atlas Tentacle attached. But I haven't attempted to upload to the board yet.

I placed only the include statements in a sketch and clicked on verify. Here is the resulting compilation errors.

CompilationErrors.txt (17.8 KB)

I believe I have been able to determine tt libraries needed for ESPmDNS need to be added to the ESPmDNS library folder and included in the #include sectin of the code. Thank you.