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 or things.
翻譯過來就是wait_for_edge會阻塞程序,直到有一個邊緣事件被觸發
event_detected就是事件觸發 具體到你這裡,要中斷請求,那隻能是用事件方式觸發了。
那第一步是讓介面電阻上拉
然後