The blades or sails of the windmill are turned by the wind. Gears and cogs makes the drive shaft inside the windmill turn. In a windmill used for making flour, this turns the grinding stones. As the stones turn, they crush the wheat (or other grain) between them. In a windmill used for pumping water, turning the drive shaft moves a piston. The piston can suck up and push out water as it moves up and down. In a windmill used for generating power, the drive shaft is connected to many gears. This increases the speed and is used to turn a generator to make electricity.