Board Thread:Questions and Answers/@comment-25523075-20170103152730/@comment-30979292-20170112011627

You can also use multiple pistons. For example, a press of a button will activate a T Flip Flop, like Holroy said. This will push a block using a sticky piston and have a regular piston next to it pushing that block away. Press the button again and the sticky piston will contract and another regular piston will push it in front of the sticky piston. Sorry if I explained too much but according to your question, this is how you should do it.