Raspberry Pi Pico Two-Way Counter | Sensor Order & Debounce
Two sensors along a passage reveal direction through the order in which they activate. A Raspberry Pi Pico can interpret one completed sequence as a crossing.
The key idea
A transition from A to B represents one direction, and B to A represents the opposite direction. Debounce and a return-to-clear condition help keep a held or noisy signal from being counted repeatedly.
What to remember
- Assign direction to a complete sensor sequence.
- Handle partial crossings and reversals explicitly.
Check your understanding
What can the counter infer from a trigger on A alone?
Show the explanation
It knows A was activated but lacks a completed sequence that identifies a crossing direction.