Différences entre versions de « Mydin-Class-TwoRelay3Mod »
Ligne 66 : | Ligne 66 : | ||
==== out1, out2 : Pin ==== | ==== out1, out2 : Pin ==== | ||
− | + | References to the {{fname|Pin}} object controling the Relay. The object are created in the {{fname|attach()}} method. | |
+ | |||
+ | The names are identicals to those used on the controler connector. | ||
+ | |||
+ | [[Fichier:Mydin-Class-TwoRelay3Mod-connector.png]] | ||
Reference to the backplane instance created by the {{fname|configure()}} function. The backplane is an instance of type BackplaneClass. | Reference to the backplane instance created by the {{fname|configure()}} function. The backplane is an instance of type BackplaneClass. |
Version du 29 avril 2025 à 23:30
Pico3Mod class
Raspberry-Pi Pico based controler for 3 modules DIN case.
The implementation of the class is closely tied to the features of the backplane bpard
Features
Board schematic
Schematic shows how the hardware is wired to the connector.
Examples
The TwoRelay3Mod repository contains many useful examples.
Your knowledge will quickly progress by reading and understanding them.
The following example show how the din object offers the access to the various inputs/outputs of the backplane (the two relays in the present case).
from mydin import configure
from mydin.pico import Pico3Mod
from mydin.backplane.relays import TwoRelay3Mod
import time
din = configure( Pico3Mod, TwoRelay3Mod )
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] )
Class Header
Attributes
out1, out2 : Pin
References to the Pin object controling the Relay. The object are created in the attach() method.
The names are identicals to those used on the controler connector.
Reference to the backplane instance created by the configure() function. The backplane is an instance of type BackplaneClass.
Methods
xxx