I want to create a circuit that when a button is pushed, one piston goes after a delay from another piston, but when the button is reset (i.e. when it is released), then the same piston retracts first and then the second piston retracts later.
1 Answer
If I understand you right, you want an "ABBA circuit": When you turn the input on, first A turns on and then B, when you turn the input off, first B turns off and then A.
The Minecraft wiki lists multiple designs for those here: https://minecraft.wiki/w/Mechanics/Redstone/Miscellaneous_circuits#ABBA_circuit (archive)
More can be found online.
An easy example is this one, using the locking feature of repeaters:
-
-
1When you turn the input on, first A turns on, then 1 RS tick later B, then 1 RS tick later the repeater in front of A gets locked. When you turn the output off, first the redstone in front of the repeater in front of A turns off, but the repeater is still locked, so it stays on, then 1 RS tick later B turns off, then 1 RS tick later the locking repeater turns off, unlocking the repeater in front of A, which turns off A. Commented Jan 14, 2020 at 8:10