Program an ESP32 Micro-controller Using Python
This is not a difficult project however it will require purchasing an ESP32 and doing some research and study.

Introduction

This project requires purchasing an ESP32 micro-controller. They generally can be purchased for less than $15. You may also need a USB cable to communicate with and power it. (The ESP32 can be powered with a USB cable, a battery pack or a separate power supply.)

There are two version of Python that run on the ESP32.

Note: I used the Adafruit ESP32-S3 TFT Feather (Product ID: 5483) when developing/testing this project. However, it has extra bells and whistles not required for the project. Any ESP32 will do. (If you can find one with Python already installed even better.)

Project #1

Many ESP32 boards have an onboard LED you can turn on and off. Write a program to blink (in Morse code)

  1. the SOS signal
  2. "Hello World!"
  3. your name
  4. The first 4 notes of Beethoven Symphony No. 5 In C Minor

Morse Code (wikipedia)

Questions: how long is a dot compared to a dash? The time between a dot and dash? The time between letters or words?

Where Can You Get Information?

Google: ESP32, CircuitPython, and MicroPython. Also search YouTube.

Search Amazon.com for ESP32.

Adafruit (home)
Adafruit, welcome to CircuitPython
Adafruit, ESP32-S3 TFT Feather
Adafruit has a lot of learning material on their website learn.adafruit.com.

MicroPython (home)
MicroPython on ESP32 (YouTube)

CircuitPython vs MicroPython

USB Cable

You will need a USB cable to connect you computer to the ESP32 for the initial setup. After setting everything up, you may be able to use Wi-Fi or Bluetooth (depending on which ESP32 board you have).

Check both your computer and the ESP32 board to see what type of connectors will be needed. In my case, I need a USB A (male) to USB C (male) cable.

Arduino IDE C Sketch

// Beethoven Symphony No. 5 In C Minor Op. 67
// (also the Morse code V)

// the setup function
void setup() {
  // initialize built in LED pin as an output.
  pinMode(LED_BUILTIN, OUTPUT);
  // initialize USB serial port
  //Serial.begin(19200);
  //Serial.println("Hello Computer");
}

// blink LED function
void myBlink(int ledDelay,int waitTime) {
  digitalWrite(LED_BUILTIN, HIGH);   // LED on
  delay(ledDelay);                   // wait (milliseconds)
  digitalWrite(LED_BUILTIN, LOW);    // LED off
  delay(waitTime);                   // wait (milliseconds)
}

// the loop function
void loop() {
  myBlink(250,200);                   // dit  (milliseconds)
  //Serial.println("dit");
  myBlink(250,200);                   // dit  (milliseconds)
  //Serial.println("dit");
  myBlink(250,200);                   // dit  (milliseconds)
  //Serial.println("dit");
  myBlink(750,1000);                  // dah  (milliseconds)
  //Serial.println("dah");
}

More ESP32 Projects