Modifications
Sauter à la navigation
Sauter à la recherche
← Modification précédente
Modification suivante →
Mydin-Class-TwoRelay3Mod
(voir la source)
Version du 29 avril 2025 à 23:01
734 octets ajoutés
,
29 avril 2025 à 23:01
→Examples
Ligne 29 :
Ligne 29 :
Your knowledge will quickly progress by reading and understanding them.
Your knowledge will quickly progress by reading and understanding them.
+
+
The following example show how the {{fname|din}} object offers the access to the various input/output of the backplane (the two relays).
+
<syntaxhighlight lang="python">
+
from mydin import configure
+
from mydin.pico import Pico3Mod
+
from mydin.backplane.relays import TwoRelay3Mod
+
import time
+
+
# Which Controler + Backplane to use
+
din = configure( Pico3Mod, TwoRelay3Mod )
+
+
# === Relays ==================================
+
print( "Manipulate the relays" )
+
din.rel1.on()
+
print( "Rel1 is", din.rel1.value() )
+
time.sleep(1)
+
+
din.rel2.on()
+
print( "Rel2 is", din.rel2.value() )
+
time.sleep(1)
+
+
print( "All relays off" )
+
for relay in din.relays:
+
relay.off()
+
+
print( "relays state", [relay.value() for relay in din.relays] )
+
</syntaxhighlight>
== Class Header ==
== Class Header ==
Admin
Bureaucrates
,
Administrateurs
32 908
modifications
Menu de navigation
Outils personnels
Se connecter
Espaces de noms
Page
Discussion
Variantes
Affichages
Lire
Voir le texte source
Voir l’historique
Plus
Rechercher
Navigation
ARDUINO
RASPBERRY-PI
[:: PI Hacking ::]
Particle.IO
Micro Python
Imprimante 3D
Actualités
Modifications récentes
Page au hasard
Aide
Outils
Pages spéciales
Version imprimable