We demonstrate the feasibility of controlling an atomic scale mechanical device by an external electrical signal. On a germanium substrate, a switching motion of pairs of atoms is induced by electrons that are directly injected into the atoms with a scanning tunneling microscope tip. By precisely controlling the tip current and distance we make two atom pairs behave like the flippers of an atomic-sized pinball machine. This atomic scale mechanical device exhibits six different configurations.