Mydin-Class-Pico3Mod
Pico3Mod class
Raspberry-Pi Pico based controler for 3 modules DIN case.
The implementation of the class is closely tied to the features included into 3 modules DIN.
The features are used to design the PCB... so the board schematic is closely tied to the Pico3Mod class implementation.
Features
Board schematic
Schematic shows how the hardware (buttons, LEDs, buses, ...) are wired to the Pico.
Class Header
Attributes
buzzer : Buzzer
xxx
pca : PCA9536
Private
led0, led1, led2, led3 : PcaPinAdapter
xx
ext_rtc : DS3231
xxx
onewire : OneWire
xxx
roms : list
xxx
rom_ds18b20 : bytes
xxx
leds : list
Property, list of PcaPinAdapter
buttons : list
Property, list of Pin
onewire_roms : list
Property, list of str
has_ds18b20 : bool
Property.
temp_ds18b20 : float
Property.
Methods
__init__()
Constructor of the Pico3Mod class, specialized version of the PicoControler for the 3 modules DIN case. This constructor will creates the objects & resources specific to the Pico3Mod board.
As Pico3Mod inherits from PicoControler and DinControler, it then inherits from the methods and properties of the both ancestors.
The __init__() creates all objects made available through the properties.
def __init__( self, BackplaneClass ):
- BackplaneClass : Class of the backplane to be associated with the controler (eg: TwoRelay3Mod).
__init__() is also responsible for:
- setting up MCU RTC with the external RTC date & time.
- setting up callbacks for the buttons
- made the LEDs accessible thanks to the PcaPinAdapter class.
- scanning the OneWire bus for existing sensors
- sound the buzzer as last init operation
was_pressed( idx ): bool
xxx
def was_pressed( self, idx ):
task_setup(): bool
xxx async def __coro_ds18b20( self ) async def __coro_monitor( self ):
def tasks_setup( self, async_evloop ):
before_run(): bool
xxx
def before_run( self ):