GPIO_CALLBCK.py 221 B

123456789101112131415
  1. import PikaStdDevice as std
  2. print('hello pikascript')
  3. io = std.GPIO()
  4. io.setPin('P4')
  5. io.setMode('in')
  6. io.enable()
  7. def cb1(signal):
  8. print('cb1', signal)
  9. io.setCallBack(cb1, io.SIGNAL_FALLING)
  10. while True:
  11. pass