The wait_for_edge() function is designed to block execution of your program until an edge is detected.
翻译过来就是wait_for_edge会阻塞程序,直到有一个边沿事件被触发
The event_detected() function is designed to be used in a loop with other things, but unlike polling it is not going to miss the change in state of an input while the CPU is busy working on other things.
翻译过来就是wait_for_edge会阻塞程序,直到有一个边沿事件被触发
event_detected就是事件触发
具体到你这里,要中断请求,那只能是用事件方式触发了。
那第一步是让接口电阻上拉
然后