Skip to content

Hatem-Zehir/MicroPython-ESP32-Examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MicroPython-ESP32-Examples

This repository features the conversion of Arduino built-In examples to MicroPython.

What are Arduino built-In Examples?

Built-In Examples are sketches found in the Arduino Software (IDE); to access them, select File > Examples from the toolbar menu. These easy programs show how to use all of the Arduino's basic commands. They cover anything from the bare minimum of a sketch to digital and analog IO, as well as the use of sensors and displays.

01.Basics

  • Analog Read Serial: Read a potentiometer, print its state out to the Serial Monitor.
  • Blink: Turn an LED on and off.
  • Digital Read Serial: Read a switch, print the state out to the Serial Monitor.
  • Fade: Demonstrates the use of analog output to fade an LED.
  • Read Analog Voltage: Reads an analog input and prints the voltage to the Serial Monitor.

02.Digital

03.Analog

  • Analog In Out Serial: Read an analog input pin, map the result, and then use that data to dim or brighten an LED.
  • Calibration: Define a maximum and minimum for expected analog sensor values.
  • Fading: Use an analog output (PWM pin) to fade an LED.
  • Smoothing: Smooth multiple readings of an analog input.

04.Communication

  • ASCIITable: Demonstrates ESP32's advanced serial output functions.
  • Dimmer: Move the mouse to change the brightness of an LED.
  • Physical Pixel: Turn a LED on and off by sending data to your ESP32 from Processing or Max/MSP.

What is MicroPython?

MicroPython is a re-implementation of Python 3 that is designed for use with microcontrollers and embedded systems. Standard Python and MicroPython are very similar. If you know how to program in Python, you'll be able to program in MicroPython as well. Using MicroPython to program the ESP32 board is a perfect way to get the best out of it. The ESP32 chip, on the other hand, is an excellent medium for using MicroPython.

Requirements

To begin, you'll need a board with an ESP32 chip. The ESP32 chip is supported by the MicroPython software, and any board should work. The most important feature of a board is how the GPIO pins are connected to the outside world, as well as whether it has a built-in USB-serial converter to connect the UART to your PC.

Flash/Upload MicroPython Firmware to ESP32

Make sure you install uPyCraft IDE on your computer: