development:python:micropython
This is an old revision of the document!
Table of Contents
ESP32 - Micropython
Cấu trúc thư mục
- boot.py: File khởi tạo các cấu hình pyboard.
- main.py: File chương trình, được thực thi sau file boot.py.
Thony IDE
- boot.py
import gc import esp from machine import Pin esp.osdebug(None) gc.collect() led2 = Pin(2, Pin.OUT)
Led
- boot.py
import gc import esp from machine import Pin esp.osdebug(None) gc.collect() led5 = Pin(5, Pin.OUT) btn26 = Pin(26, Pin.IN, Pin.PULL_UP) def btn26_handler(p): if btn26.value() != 1: return led5.value(not led5.value()) btn26.irq(trigger=Pin.IRQ_RISING | Pin.IRQ_FALLING, handler=btn26_handler)
development/python/micropython.1723649593.txt.gz · Last modified: 2024/08/14 15:33 by tungnt