Please keep in mind that this is a conceptual idea, not a pattern and it has not been tested. It is presented here for entertainment and conceptual idea purposes only.
This is similar to a electromechanical device I found in old slot machines, back before computers. Although in the slot machine it was used to activate an electrical switch, much like a person pushing a button. The mechanics of this gear assembly could be used in numerous ways, such as simulating a person pushing a button, oars on a rowboat, or any other application that requires a back-and-forth or repeat motion. It is important to note that this assembly may have to be constructed out of a heavy-duty material (such as plastic or metal ) depending on how much wear and tear the device would go through. Make sure that the upper gear has room on the slider to move back and forth and that on the lower gear that the teeth are positioned properly. This setup will take some trial and error in order to figure out the best position for the lower gear. The spring on the upper gear should be of light weight and may also require testing of different lengths and strengths. If the spring is too heavy a propeller on a whirligig would not be able to turn the gear. As I stated before this is a conceptual idea and in theory it should work, but as with any new idea it is going to take a great deal of trial and error to figure out what works.
Note: this configuration could also be used vertically for the up-and-down motion of butterfly wings.