A joystick is a computer peripheral or general control device consisting of a handheld stick that pivots about one end and transmits its angle in two or three dimensions to a computer. Most joysticks are two-dimensional, having two axes of movement, just like a mouse, but three-dimensional joysticks do exist.
Joysticks are often used to control games, and usually have one or more push-buttons whose state can also be read by the computer.
Most I/O interface cards for PCs have a joystick (game control) port. Modern joysticks (as of 2003) mostly use a USB interface for connection to the PC.
Apart for controlling games, joysticks are also used for controlling machines such as elevators, cranes and trucks.
one-button game joystick
An analog joystick is a joystick which has continuous states, i.e. returns an angle measure of the movement in any direction in the plane or the space (usually utilizing potentiometers) and a digital joystick gives only on/off signals for four different directions, and mechanically possible combinations (such as up-right, down-left, &c.). (Digital joysticks were very common as game controllers for the video game consoles, arcade machines, and home computers of the 1980s.)
Additionally joysticks often have one or more fire buttons, used to trigger some kind of action. These are digital.
Joysticks were originally controls for an aircraft's ailerons and elevators. They were fixed to the floor of the aircraft and stuck up between the pilot's legs, hence the name.
The first electrical 2-axis joystick was probably invented around 1944 in Nazi Germany. The device was developed for targeting the glide bomb Henschel Hs 293 against ship targets. Here, the joystick was used by an operator to steer the missile towards its target by radio control. This joystick had on-off switches rather than analogue sensors, i.e. a digital joystick. The signal was transmitted from the joystick to the missile by a thin wire.
This invention was picked up by someone in the team of scientist assembled at the Heeresversuchsanstalt in Peenemünde. Here a part of the team on the German rocket program was developing the Wasserfall missile, a successor to the V-2 rocket, the first ground-to-air missile intended for shooting down enemy aircraft. The Wasserfall steering equipment converted the electrical signal to radio signals and transmitted these to the missile.
The Atari standard joystick, developed for the Atari 2600 was a digital joystick, with a single 'fire' button, and connected via a DB9 connector, the electrical specifications for which was for many years the 'standard' digital joystick specification. Joysticks were commonly used as controllers in first and second generation game consoles, but then gave way to the familiar control pad with the Nintendo Entertainment System and Sega Master System in 1985 and 86, though joysticks - especially arcade-style ones - were and are popular after-market add-ons for any console.