Skip to content
  • Damien George's avatar
    stmhal: Make switch a class, to follow suit of all other modules. · 6125ba4a
    Damien George authored
    Instead of pyb.switch() as a function, it's more consistent (with
    respect to all the other modules and peripherals) to have
    pyb.Switch() create a switch object.  This then generalises to having
    multiple switches.  Call the object to get its state.  Use sw.callback
    to set the callback function for when the switch is pressed.
    6125ba4a