switches.py
569 Bytes
"""
author Benoit Dubois
copyright FEMTO Engineering, 2021
licence GPL v3+
brief Collector for aggregating pins used as switches in PID servo app.
"""
class Switches(object):
"""Collector for aggregating pins used as switches in PID servo app.
"""
def __init__(self, p1, i1, p2, i2):
"""Parameters are pin identifiers allowable by pyb.Pin class (e.g. pin
object, CPU pin, string matching board pin...).
"""
self.p1 = pyb.Pin(p1)
self.i1 = pyb.Pin(i1)
self.p2 = pyb.Pin(p2)
self.i2 = pyb.Pin(i2)