Using 1 motor for 2 different functions

I believe this is what is meant by a 4-bar transmission as mentioned by Xenon27:

We personally use one of these 4-bar transmissions on our robot and it works great but it requires two motors not one.

An alternative to the double ratchet would be this:
image
The below image only has one of the two output gears connected.
WIN_20190329_20_30_02_Pro%20(2)
(Edit to clarify):
The design relies on the friction of the ‘drive arm’ with the motor axle to swing the arm into engagement with one of the two output gears depending on the direction the motor is turning.