IT, Knowledge

Getting Started ESP32 with Visual Studio Code

  1. Install PlatformIO extension to VSCode
  2. Create a new Project there
  3. Add a Name and Select NodeMCU 32S as the Board type and Arduino as the Platform
  4. After creating the project check this code in the main.cpp file in the src folder
#include <Arduino.h>

void setup() {
  Serial.begin(115200);
  pinMode(LED_BUILTIN, OUTPUT);
  Serial.println("Hello World!");
}

void loop() {
  digitalWrite(LED_BUILTIN, HIGH);
  delay(1000);
  digitalWrite(LED_BUILTIN, LOW);
  delay(500);
  Serial.println("Hello from Loop!");
}

5. Upload the code to the device by clicking the right Arrow

6. Make sure to add the bus speed to platformio.ini file as 115200

[env:nodemcu-32s]
platform = espressif32
board = nodemcu-32s
framework = arduino
monitor_speed = 115200

You can check it in the Serial Monitor tab. Select /dev/tty.usbserial-001 as the Port and 115200 as the Baud Rate.

What’s your reaction about this article?
+1
0
+1
2
+1
0
+1
0
+1
0

Leave a Reply

Your email address will not be published. Required fields are marked *