switch.py 87 B

123456
  1. from pyb import Switch
  2. sw = Switch()
  3. print(sw())
  4. sw.callback(print)
  5. sw.callback(None)