Skip to content

Commit db84d05

Browse files
authored
README.md
1 parent 88ec726 commit db84d05

File tree

1 file changed

+31
-36
lines changed

1 file changed

+31
-36
lines changed

README.md

Lines changed: 31 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,73 @@
11
# MicroPython-ESP32-Examples
2-
This repository features the conversion of Arduino built-In examples to MicroPython.
2+
Explore this repository to discover the conversion of Arduino's built-in examples to MicroPython. These resources offer developers the ability to learn and utilize the versatility and functionality of MicroPython. Take advantage of this valuable resource and expand your coding skills today.
33

4-
# Software Requirements:
5-
- Thonny IDE (or your favourite IDE)
6-
7-
# Hardware Requirements:
8-
- ESP32
9-
- USB Cable
4+
# Requirements:
5+
To get started with this project, you will need to ensure that you have the appropriate software and hardware. You will require an IDE such as Thonny, or your preferred alternative, to facilitate the coding process. Additionally, you will need an ESP32 and a USB cable to connect it to your computer. With these necessary components, you can begin working on your project.
106

117
# What are Arduino built-In Examples?
12-
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.
8+
If you're new to Arduino, the built-in examples are an essential resource to help you understand how to use the device's basic commands. These simple programs can be found in the Arduino Software (IDE) by selecting File > Examples from the toolbar menu. From digital and analog IO to sensor and display usage, these examples cover everything from the basics of a sketch to more complex tasks. With the built-in examples, you can quickly get started with your Arduino projects.
139

1410
## 01.Basics
15-
- [Analog Read Serial](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/01.Basics/AnalogReadSerial.py): Read a potentiometer, print its state out to the Serial Monitor.
16-
- [Blink](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/01.Basics/Blink.py): Turn an LED on and off.
17-
- [Digital Read Serial](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/01.Basics/DigitalReadSerial.py): Read a switch, print the state out to the Serial Monitor.
18-
- [Fade](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/01.Basics/Fade.py): Demonstrates the use of analog output to fade an LED.
19-
- [Read Analog Voltage](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/01.Basics/ReadAnalogVoltage.py): Reads an analog input and prints the voltage to the Serial Monitor.
11+
- [Analog Read Serial](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/01.Basics/AnalogReadSerial.py): Learn how to read the state of a potentiometer and output it to the Serial Monitor.
12+
13+
- [Blink](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/01.Basics/Blink.py): Discover how to toggle an LED on and off with ease.
14+
- [Digital Read Serial](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/01.Basics/DigitalReadSerial.py): Learn how to read the state of a switch and output it to the Serial Monitor.
15+
- [Fade](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/01.Basics/Fade.py): Discover how to control the brightness of an LED with analog output in this example that demonstrates the fading effect..
16+
- [Read Analog Voltage](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/01.Basics/ReadAnalogVoltage.py): Learn how to read an analog input and output the voltage to the Serial Monitor.
2017

2118
## 02.Digital
22-
- [Blink Without Delay](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/02.Digital/BlinkWithoutDelay.py): Blink an LED without using the sleep() function.
23-
- [Button](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/02.Digital/Button.py): Use a pushbutton to control an LED.
24-
- [Debounce](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/02.Digital/Debounce.py): Read a pushbutton, filtering noise.
25-
- [Digital Input Pullup](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/02.Digital/DigitalInputPullUp.py): Demonstrates the use of Pin.PULL_UP.
19+
- [Blink Without Delay](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/02.Digital/BlinkWithoutDelay.py): Explore how to blink an LED without utilizing the sleep() function.
20+
- [Button](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/02.Digital/Button.py): Learn how to use a pushbutton to control an LED.
21+
- [Debounce](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/02.Digital/Debounce.py): Discover how to read a pushbutton while filtering out noise.
22+
- [Digital Input Pullup](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/02.Digital/DigitalInputPullUp.py): Explore the utilization of Pin.PULL_UP in this example, which demonstrates its effectiveness in pulling up the input value of a pin.
2623

2724
## 03.Analog
28-
- [Analog In Out Serial](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/03.Analog/AnalogInOutSerial.py): Read an analog input pin, map the result, and then use that data to dim or brighten an LED.
29-
- [Calibration](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/03.Analog/Calibration.py): Define a maximum and minimum for expected analog sensor values.
30-
- [Fading](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/03.Analog/Fading.py): Use an analog output (PWM pin) to fade an LED.
31-
- [Smoothing](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/03.Analog/Smoothing.py): Smooth multiple readings of an analog input.
25+
- [Analog In Out Serial](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/03.Analog/AnalogInOutSerial.py): Learn how to read an analog input pin, map the result, and utilize that data to adjust the brightness of an LED.
26+
- [Calibration](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/03.Analog/Calibration.py): Learn how to define a minimum and maximum for expected analog sensor values.
27+
- [Fading](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/03.Analog/Fading.py): Discover how to use an analog output (PWM pin) to create a fading effect on an LED.
28+
- [Smoothing](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/03.Analog/Smoothing.py): Learn how to smooth multiple readings of an analog input with this example, which provides step-by-step guidance..
3229

3330
## 04.Communication
34-
- [ASCIITable](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/04.Communication/ASCIITable.py): Demonstrates ESP32's advanced serial output functions.
35-
- [Dimmer](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/04.Communication/Dimmer.py): Move the mouse to change the brightness of an LED.
36-
- [Physical Pixel](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/04.Communication/PhysicalPixel.py): Turn a LED on and off by sending data to your ESP32 from Processing or Max/MSP.
31+
- [ASCIITable](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/04.Communication/ASCIITable.py): Explore the advanced serial output functions of the ESP32 with this comprehensive example, which demonstrates its features and capabilities.
32+
- [Dimmer](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/04.Communication/Dimmer.py): Learn how to adjust the brightness of an LED by moving the mouse.
33+
- [Physical Pixel](https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/04.Communication/PhysicalPixel.py): Discover how to toggle an LED on and off by transmitting data to your ESP32 from Processing or Max/MSP.
3734

38-
# What is MicroPython?
39-
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.
40-
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.
35+
MicroPython is a specialized version of Python 3, created specifically for use in microcontrollers and embedded systems. While standard Python and MicroPython are similar, the latter is optimized for smaller devices. If you're already familiar with Python, you'll find programming in MicroPython straightforward. Using MicroPython to program the ESP32 board is an excellent way to take full advantage of its capabilities. Furthermore, the ESP32 chip is an ideal platform for using MicroPython, making it easy to develop projects for a variety of applications.
4136

4237
# Requirements
43-
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.
38+
Before you can get started, you'll need a board equipped with an ESP32 chip. Fortunately, the MicroPython software supports the ESP32 chip, and any board should suffice. The critical consideration when selecting a board is how the GPIO pins are connected to external devices, as well as whether it includes a built-in USB-serial converter that connects the UART to your PC. With these requirements met, you can start programming your board using MicroPython to create a wide range of projects.
4439

4540
# Flash/Upload MicroPython Firmware to ESP32
46-
Make sure you install uPyCraft IDE on your computer:
41+
To begin using MicroPython with your ESP32 board, you'll need to flash/upload the MicroPython firmware. To do so, you must first install the uPyCraft IDE on your computer. Depending on your operating system, you can download the uPyCraft IDE for Windows, MAC OS X, or Linux from the provided links. Once you have installed the uPyCraft IDE, you can proceed with flashing the MicroPython firmware onto your ESP32 board and start programming it using MicroPython.
4742
- [uPyCraft IDE for Windows](https://github.com/DFRobot/uPyCraft/raw/master/uPyCraft.exe)
4843
- [uPyCraft IDE for MAC OS X](https://github.com/DFRobot/uPyCraft_src)
4944
- [uPyCraft IDE for Linux](https://github.com/DFRobot/uPyCraft_src)
5045

51-
You can easily flash your ESP32 board with MicroPython firmware if you have the uPyCraft IDE installed on your computer.
46+
Flashing your ESP32 board with MicroPython firmware is a straightforward process if you have the uPyCraft IDE already installed on your computer. With the uPyCraft IDE, you can upload the firmware and begin programming your ESP32 board with MicroPython to create a wide range of projects.
5247

5348
## Getting the firmware
54-
The first step is to get the most recent MicroPython firmware.bin file and load it onto your ESP32 device. It's available for download on the [MicroPython downloads page](https://micropython.org/download/esp32/). You have three options:
49+
To flash your ESP32 board with MicroPython firmware, you must first download the latest MicroPython firmware.bin file from the official [MicroPython downloads page](https://micropython.org/download/esp32/). You have three firmware options to choose from:
5550
- Stable firmware builds
5651
- Daily firmware builds
5752
- Daily firmware builds with SPIRAM support
5853

5954
## Deploying the firmware
6055
### Selecting Serial Port
61-
Go to Tools > Serial and select your ESP32 COM port (in our case it’s COM3).
56+
To deploy the MicroPython firmware onto your ESP32 board, you need to select the correct serial port in the uPyCraft IDE. To do this, navigate to the "Tools" menu and click on "Serial." From the drop-down menu, select the COM port that corresponds to your ESP32 board (e.g., COM3). This will ensure that the firmware is uploaded to the correct device and ready for use.
6257

6358
<p align="center">
6459
<img src="https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/assets/uPyCraft-IDE-Select-Serial-Port-COM3.png">
6560
</p>
6661

6762
### Selecting the Board
68-
Go to Tools > Board. make sure you select the "esp32" option:
63+
To continue with deploying the MicroPython firmware, the next step is to select the correct board in the uPyCraft IDE. Simply navigate to the "Tools" menu and click on "Board." From the options available, select "esp32" to ensure that the firmware is compatible with your board. This step is essential to ensure that the firmware and board communicate correctly and avoid any errors during the upload process.
6964

7065
<p align="center">
7166
<img src="https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/assets/uPyCraft-IDE-Select-Board-ESP32.png">
7267
</p>
7368

7469
### Flashing/Uploading MicroPython Firmware
75-
Finally, go to Tools > BurnFirmware menu to flash your ESP32 with MicroPython.
70+
Finally, to flash your ESP32 with MicroPython firmware, go to Tools > BurnFirmware menu in uPyCraft IDE. Select the firmware.bin file you downloaded and click the "Burn" button to start the flashing process. Once the process is completed, you can start programming your ESP32 with MicroPython!
7671

7772
<p align="center">
7873
<img src="https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/assets/uPyCraft-IDE-Tools-burn-Firmware.png">
@@ -89,13 +84,13 @@ Select all these options to flash the ESP32 board:
8984
<img src="https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/assets/flash-firmware-esp32-prepare.png">
9085
</p>
9186

92-
Having all the settings selected, hold-down the "BOOT/FLASH" button in your ESP32 board. While holding down the “BOOT/FLASH“, click the “ok” button in the burn firmware window:
87+
To flash the ESP32 board with MicroPython firmware, ensure that you have selected the appropriate board, burn address, erased the flash, and chosen the COM port and firmware file. Then, press and hold the "BOOT/FLASH" button on your ESP32 board while clicking the "ok" button in the firmware burning window. This will initiate the firmware flashing process.
9388

9489
<p align="center">
9590
<img src="https://github.com/Hatem-Zehir/MicroPython-ESP32-Examples/blob/main/assets/OK-update-firmware-esp32.png">
9691
</p>
9792

98-
When the "EraseFlash" process begins, you can release the "BOOT/FLASH" button. After a few seconds, the firmware will be flashed into your ESP32 board.
93+
After starting the "EraseFlash" process, you can release the "BOOT/FLASH" button on your ESP32 board. Within a few seconds, the firmware will be flashed onto the board.
9994

10095
# Further Reading
10196
- [Built-In Examples | Arduino](https://www.arduino.cc/en/Tutorial/BuiltInExamples)

0 commit comments

Comments
 (0)