In this tutorial I show how to install C++ and setup Visual Studio Code for C, C++ and Arduino development on Windows. Click here if you are a MacOS user.
Here is the link to Visual Studio Code. I also received questions on what Arduino kit I plan on using in my upcoming tutorials. If you get the Unable to open ‘PIO Home’ error, here is the fix.
Common Error Fixes
If you get the G++ is not recognized error here is how you fix it
1. Search for environment in Start search
2. Click Edit the System Environment Variables
3. Click Environment Variables button
4. Click Path and Edit button
5. Click New button
6. Type C:\cygwin64\bin and save ( Check that C:\cygwin64\bin exists as a folder)
If you like videos like this consider donating $1, or simply turn off AdBlocker. Either helps me to continue to make free tutorials.
helloworld.cpp
1 2 3 4 5 6 |
#include <iostream> int main(){ std::cout << "Hello World" << std::endl; return 0; } |
Arduino main.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
#include "Arduino.h" void setup() { // initialize LED digital pin as an output. pinMode(LED_BUILTIN, OUTPUT); } void loop() { // turn the LED on (HIGH is the voltage level) digitalWrite(LED_BUILTIN, HIGH); // wait for a second delay(100); // turn the LED off by making the voltage LOW digitalWrite(LED_BUILTIN, LOW); // wait for a second delay(100); } |
Leave a Reply