Modifications

Sauter à la navigation Sauter à la recherche
195 octets ajoutés ,  1 août 2024 à 16:41
Ligne 15 : Ligne 15 :  
== Utilisation ==
 
== Utilisation ==
   −
=== Raspberry-Pi Pico ===
+
=== Raspberry-Pi Pico et MicroPython ===
 
Voici un exemple de raccordement sur le GPIO 6 (GP6) du Raspberry-Pi Pico
 
Voici un exemple de raccordement sur le GPIO 6 (GP6) du Raspberry-Pi Pico
   Ligne 27 : Ligne 27 :     
<syntaxhighlight lang="python">
 
<syntaxhighlight lang="python">
−
x
+
from machine import Pin
 +
import time
 +
 
 +
p = Pin( Pin.board.GP6, Pin.OUT, value=False )
 +
# Active le relais
 +
p.on()
 +
# attendre 10 secondes
 +
time.sleep( 10 )
 +
# désactiver le relais
 +
o.off()
 
</syntaxhighlight>
 
</syntaxhighlight>
  
32 920

modifications

Menu de navigation