Published by Vivian van Zyl in ESP32 Microcontrollers the 01/15/2025 at 09:26 pm
In this blog, we will explore the ESP32 C6, a versatile microcontroller that enables exciting projects like LED flashing through programming in CircuitPython. We’ll guide you through setting it up with your PC, installing necessary software, and running your first LED program.
The ESP32 C6 is a powerful microcontroller that integrates Wi-Fi and Bluetooth connectivity, making it an excellent choice for IoT projects. Its versatility allows developers to create various applications ranging from simple LED blinking to complex AI-driven systems.
This microcontroller stands out due to its low power consumption and extensive feature set, making it suitable for battery-operated devices. With the ESP32 C6, you have the capability to connect multiple devices seamlessly within a network.
Microcontrollers are compact integrated circuits designed to govern a specific operation in an embedded system. They consist of a processor, memory, and input/output peripherals on a single chip. The ESP32 C6 is one such microcontroller that excels in both performance and functionality.
Microcontrollers are widely used in various applications, including automation, robotics, and consumer electronics. The ESP32 C6, with its dual-core processor, can handle multiple tasks simultaneously, making it a preferred choice for developers.
To begin programming the ESP32 C6, you need to install CircuitPython. This user-friendly programming environment simplifies the coding process, making it accessible to all skill levels.
First, download the CircuitPython firmware for the ESP32 C6 from the official website. Once downloaded, connect your ESP32 C6 board to your computer via USB.

Next, use the Adafruit ESP tool to flash the firmware onto the microcontroller. This tool streamlines the installation process and ensures everything is set up correctly.

After successfully flashing the firmware, you will see the CircuitPython file system appear on your computer, indicating the installation was successful.
Thonny is an integrated development environment (IDE) that simplifies coding in Python and CircuitPython. To get started, download and install Thonny from its official website. The installation process is straightforward and compatible with Windows, Mac, and Linux.
After installation, configure Thonny to recognize the ESP32 C6. In Thonny, go to the 'Tools' menu, select 'Options,' and then choose 'Interpreter.' Here, select 'CircuitPython' and let Thonny automatically detect the port.

Once configured, Thonny will allow you to write and upload code directly to the ESP32 C6, making development a breeze.
Flashing an LED is a classic beginner project that demonstrates the capabilities of the ESP32 C6. Start by connecting an LED to the board, ensuring the longer leg connects to a GPIO pin (for example, D2) through a resistor.

In Thonny, write a simple program to control the LED. The code will import the necessary libraries, define the pin, and create a loop to turn the LED on and off at intervals.
import time
import board
import digitalio
led = digitalio.DigitalInOut(board.D2)
led.direction = digitalio.Direction.OUTPUT
while True:
led.value = True
time.sleep(1)
led.value = False
time.sleep(1)
After writing the code, save it as code.py on the ESP32 C6. Upon resetting the board, the LED should start flashing, indicating that your program is running successfully.

While working with the ESP32 C6 and CircuitPython, you may encounter some common issues. Here are a few troubleshooting tips to help you overcome them:
By following these steps, you can resolve many common issues and continue developing exciting projects with the ESP32 C6.
The ESP32 C6 is packed with features that make it a standout choice for both hobbyists and professionals. Its dual-core processor allows for efficient multitasking, while integrated Wi-Fi and Bluetooth make connectivity seamless.
Here are some key features that are noteworthy:
The Adafruit ESP tool is a versatile application that simplifies the process of flashing firmware onto the ESP32. This tool is user-friendly and supports both Mac and Windows operating systems.
To use the Adafruit ESP tool: (or use the online version here.. )
Once the programming is complete, the tool will verify the installation, confirming that CircuitPython is successfully flashed onto the ESP32.
Connecting the ESP32 to your hardware components is a crucial step. Let's focus on connecting an LED, which is a common first project.
To connect an LED to your ESP32, follow these steps:
Ensure all connections are secure to avoid any issues during testing. Once connected, your hardware setup is ready for programming.
With the hardware connected, it’s time to test your LED flashing code. This program will turn the LED on and off at specified intervals, demonstrating the functionality of the ESP32.
Here’s a simple code snippet to get you started:
import time
import board
import digitalio
led = digitalio.DigitalInOut(board.D2)
led.direction = digitalio.Direction.OUTPUT
while True:
led.value = True
time.sleep(1) # LED ON
led.value = False
time.sleep(1) # LED OFF
Save this code as code.py in your CircuitPython file system. When you reset the ESP32, the LED should start flashing as programmed.
Now that you have a basic understanding of the ESP32 and have tested a simple LED program, the next exciting step is to build an API server. This will allow your ESP32 to communicate with other devices over the network.
To create an API server on the ESP32, you will need to use libraries that support HTTP requests. Here’s a basic outline of what you’ll do:
This project opens up a world of possibilities for remote control and data monitoring. The API server can be expanded to include different functionalities based on your project needs.
As you dive deeper into programming the ESP32, you may have some questions. Here are some frequently asked questions that can help clarify common concerns: