Blinky with PlatformIO VS Code on ESP32-C3

dev board ESP32-C3-DevKitM-1
chip ESP32-C3-MINI-1-N4
features blinky led serial esp32c3 platformio

Before starting

Dependancies

Ensure the following dependancies are downloaded and available:

Pre-requisites

Try these simpler or similar examples:

Buy the components

Code

Download code src/main.cpp
#include <Arduino.h>

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
  digitalWrite(LED_BUILTIN, LOW);

  Serial.begin(115200);
  Serial.println("Start blinky");
}

void loop() {
  Serial.println("LED ON");
  digitalWrite(LED_BUILTIN, LOW);
  delay(200);

  Serial.println("LED OFF");
  digitalWrite(LED_BUILTIN, HIGH);
  delay(200);
}

Prototype

A photo of the actual setup.

Blinky with PlatformIO VS Code on ESP32-C3 prototype

Serial console

Serial output from the firmware.

Blinky with PlatformIO VS Code on ESP32-C3 serial console

Description

The on-board LED LED_BUILTIN is GPIO8 as defined in the pin out.

Compile and upload the firmware via the PlatformIO plugin on VS Code

References