The crankshaft is that part of an engine which translates linear piston motion into rotation. Generally more than one piston is attached to the crank to provide a smoother delivery of power to the rotating part, though many small engines, such as those found in mopeds or garden machinery, use only a single piston.
The configuration and number of pistons in relation to each other and the crank leads to straight, V or flat engines.
Some (outdated) aircraft engines had a fixed crankshaft and rotating cylinders in a star configuration - rotary piston engine.
In the Wankel engine, the rotors drive the eccentric shaft, which can be considered the equivalent of the crankshaft in a piston engine.