1 Select the rising edge of the counting pulse to trigger the interrupt, that is, set the external interrupt 0 as the edge trigger mode.
2 After entering the interrupt service program of external interrupt 0, let external interrupt 0 turn off the interrupt first to avoid multiple interrupts when counting a pulse.
After counting 3 plus 1, it needs to delay for a period of time, and then let the external interrupt 0 restart the interrupt after the counting pulse is stable.
Hehe, try it quickly. If it's right, give me extra points.