EasyManuals Logo

SunFounder ESP32 User Manual

Default Icon
771 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #316 background imageLoading...
Page #316 background image
SunFounder ESP32 Starter Kit
4. Finally, click “Run Current Script” or press F5 to execute it.
5. After the code runs, you will see the LED blinking.
How it works?
1. It imports two modules, machine and time. The machine module provides low-level access to the microcon-
troller’s hardware, while the time module provides functions for time-related operations.
import machine
import time
2. Then set up the pin26 as an output pin using the machine.Pin() function with the machine.Pin.OUT argument.
led = machine.Pin(26, machine.Pin.OUT)
3. In the While True loop, the LED is turned on for one second by setting the value of the pin26 to 1 using
led.value(1) and then set to 0(led.value(0)) to turn it off for one second, and so on in an infinite loop.
310 Chapter 3. For MicroPython User

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the SunFounder ESP32 and is the answer not in the manual?

SunFounder ESP32 Specifications

General IconGeneral
BrandSunFounder
ModelESP32
CategoryController
LanguageEnglish