Concept Flow - Rising, falling, and change triggers
Start
Read Pin State
Compare Current and Previous State
If Rising Edge?
Yes→Trigger Rising Event
If Falling Edge?
Yes→Trigger Falling Event
If Change?
Yes→Trigger Change Event
Update Previous State
Repeat
The program repeatedly reads a pin's state, compares it to the previous state, and triggers events on rising, falling, or any change.