Skip to main content

Project Overview

CircuitPython is an ideal programming language for XIAO ESP32S3 as it simplifies physical computing projects. Based on Python, it has beginner-friendly syntax and includes modules for accessing hardware like sensors and displays. Since CircuitPython already supports the ESP32S3 chip, this project attempts to compile CircuitPython on Seeed Studio XIAO ESP32S3 Board.

Hardware Preparation

I am using Seeed Studio XIAO ESPS3 and Seeed Studio Grove OLED Display 0.96 as the hardware here.

Seeed Studio XIAO ESP32S3Seeed Studio Grove OLED Display 0.96

Software Preparation

I am using Thonny IDE software(Windows) and some related libraries and files.

Thonny IDErelated files(libraries)
info

Before using it, it is required for me to state the software/firmware I'm using here is designed for the ESP32S3 chip. Hence when you are trying to use pin, make sure the General Purpose Input/Output instead of the pin on the board.
For example, when you are trying to use the pin in the first row on the left. Make sure it is GPIO1 instead of A0 or D0.

Getting Started

Connect the XIAO ESP32S3 board to PC under the BootLoader Mode

The specific method is:

  • Step 1. Press and hold the BOOT button on the XIAO ESP32S3 without releasing it.

  • Step 2. Keep the BOOT button pressed and then connect to the computer via the data cable. Release the BOOT button after connecting to the computer.

  • Step 3. Upload the Blink program to check the operation of the XIAO ESP32S3.

Open Thonny and Configure the options

  1. After running Thonny, navigate "Tools -> Options" and click the "Options" selection
  1. Select "Interpreter" option and click the "CircuitPython (generic)" selection

Flash CircuitPython firmware to the XIAO ESP32S3 board

  1. Click on "(esptool)" in Thonny. It will prompt you to download the latest CircuitPython firmware and flash it to the board.
  1. The "(esptool)" in Thonny is shown like below and fisrtly choose the right "Target port".
  1. Select the CircuitPython family as "ESP32-S3" and choose variant as "Espressif•ESP32-S3-DevKitC-1-N8".
  1. Thonny will fill the reset and you can click the "Install" now.
  1. After a while showing "Done", the window can be closed.
  1. There will be a "CIRCUITPY" driver on the PC, which shows the board has successfully been flashed.

Copy all the files from the related files(library) to the "CIRCUITPY" driver.

note

The "adafruit_ssd1306.mpy" file and "adafruit_framebuf.mpy" file are necessary while using "Seeed Studio Grove OLED Display 0.96"

The adafruit_framebuf library uses a font file named font5x8.bin to render text. This file needs to be accessible within the environment where your code is executed.

Write code(IIC) and upload to achieve OLED display

  1. After adding the files, I can now import the adafruit_ssd1306 library into the code using the command import adafruit_ssd1306 and the environment is now configured to drive the OLED display. The code is shown below:
from board import *
from busio import I2C
import busio
import adafruit_ssd1306

i2c = I2C(IO6,IO5) # Initialize I2C communication using IO6 and IO5 pins

# Create a display object with 128x64 resolution and an I2C address of 0x3C
display = adafruit_ssd1306.SSD1306_I2C(128, 64, i2c, addr=0x3C)

# Clear the display
display.fill(0)
display.show()

# Write text on the display
display.text('SeeedStudio ESP32S3', 0, 0 , 1)
display.text('Code by CircuitPython!', 0, 20 , 2)
display.show()
  1. Upload the code by clicking the "Run" buttion
  1. The final result

What's more

✨ Contributor Project

Tech Support & Product Discussion

Thank you for choosing our products! We are here to provide you with different support to ensure that your experience with our products is as smooth as possible. We offer several communication channels to cater to different preferences and needs.

Loading Comments...