Lessons · Industrial control · one-shots
True for exactly one scan
Rising edge: input true now AND a memory of last scan false. Falling edge: the reverse. Write the memory after.
Hone is a place to practise programming. This is one of its lessons, written out in full and free to read without an account.
What it is for
Counting parts, starting a cycle once per press, toggling.
How to think about it
What was the input last scan? Pulse = [In] [/Was]. Then, below, Was = [In]. The order makes Was one scan behind.
Worked example
[Btn] [/BtnWas] (Press)True only on the scan Btn first goes true.
[Btn] (BtnWas)Memory, written after it was read.
Your turn
Falling edge.
[Btn] [BtnWas] (Release) [Btn] (BtnWas)
Run a rung and watch the scan
The trap
Writing the memory rung ABOVE the pulse rung. Then they are equal every scan and the pulse never fires.
Practise one-shots on HoneA question on it now, a coding challenge where there is one, and it is remembered for review. Free, no email needed.