| Ligne 164 : |
Ligne 164 : |
| | </syntaxhighlight> | | </syntaxhighlight> |
| | | | |
| | + | == Méthodes on() et off() == |
| | + | |
| | + | <syntaxhighlight lang="python" line highlight="6,10"> |
| | + | from machine import Pin |
| | + | import time |
| | + | p = Pin( 2, Pin.OUT ) |
| | + | |
| | + | # Allumer la LED |
| | + | p.on() |
| | + | time.sleep(1) |
| | + | |
| | + | # Eteindre la LED |
| | + | p.off() |
| | + | </syntaxhighlight> |
| | | | |
| | {{P2E-TRAILER}} | | {{P2E-TRAILER}} |