circuitpython/tests/pyb/switch.py

7 lines
91 B
Python

from pyb import Switch
sw = pyb.Switch()
print(sw())
sw.callback(print)
sw.callback(None)