Micropython and ESP32 blink an led

In this example we will use Micropython on an ESP32, the tool I will use is called uPyCraft which makes the task easy

You will need to download the tool first, the latest version I have seen is available from – https://git.oschina.net/dfrobot/upycraft/raw/master/uPyCraft_V0.27.exe.

Start the tool and connect your ESP32 board

Open up the Tools and set the Serial port for your ESP32 board
Open up the Tools and set the ESP32 board in the board menu

Parts List

1 x ESP32 board
1 x LED
1 x 470 ohm resistor
1 x breadboard
Connecting wire

 

Schematic

esp32 and led
esp32 and led

 

Code

Insert the code below into the editor and click on the DownloadRun button

 

[codesyntax lang=”python”]

import time
from machine import Pin
led=Pin(15,Pin.OUT)

while True:
led.value(1)
time.sleep(0.5)
led.value(0)
time.sleep(0.5)

[/codesyntax]

 

Links

Official DOIT ESP32 Development Board WiFi+Bluetooth Ultra-Low Power Consumption Dual Core