development:python:micropython
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
development:python:micropython [2024/08/15 14:45] – [OLed] tungnt | development:python:micropython [2024/08/15 14:47] (current) – [OLed] tungnt | ||
---|---|---|---|
Line 32: | Line 32: | ||
{{ : | {{ : | ||
- | ====== | + | ====== |
- | * [[https:// | + | * [[development: |
- | * [[https:// | + | * [[development:python: |
- | * [[https:// | + | |
- | <file python 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, | ||
- | </ | ||
- | |||
- | {{ : | ||
- | |||
- | ====== OLed ====== | ||
- | |||
- | * [[development: |
development/python/micropython.1723733152.txt.gz · Last modified: 2024/08/15 14:45 by tungnt