Ligne 20 : |
Ligne 20 : |
| rel2.on() | | rel2.on() |
| rel2.off() | | rel2.off() |
| + | </syntaxhighlight> |
| + | |
| + | == Utiliser le bouton utilisateur == |
| + | |
| + | Le bouton utilisateur est raccordé sur le GPIO 34. |
| + | |
| + | [[Fichier:MicroPython-esp32-evb-button.png]] |
| + | |
| + | |
| + | <syntaxhighlight lang="python"> |
| + | from machine import Pin |
| + | from time import sleep_ms |
| + | |
| + | btn = Pin( 34, Pin.IN ) |
| + | |
| </syntaxhighlight> | | </syntaxhighlight> |
| | | |