pikapython/examples/Device/GPIO_CALLBCK.py
李昂 6c1d9ebc81
update examples/Device/GPIO_CALLBCK.py.
Signed-off-by: 李昂 <liang6516@outlook.com>
2022-12-23 11:21:21 +00:00

16 lines
221 B
Python

import PikaStdDevice as std
print('hello pikascript')
io = std.GPIO()
io.setPin('P4')
io.setMode('in')
io.enable()
def cb1(signal):
print('cb1', signal)
io.setCallBack(cb1, io.SIGNAL_FALLING)
while True:
pass