This is a multi-purpose mechanism called an indexing gear (I think). The larger gear spins continuously and its partial teeth engage with the smaller gear, making it rotate 180º with every rotation of the larger gear. This assembly uses skateboard bearings (608 ZZ) to achieve the smooth rotational motion.
I made a pingpong ball hopper with a trigger attachment to demonstrate the action.
Check out the instructable for all the details about how to make your own: https://www.instructables.com/id/3D-Printed-Indexing-Gears/