In a method of controlling a rotary sprinkler (100), a first angular position (310) and a first watering distance (146) are accessed from memory (166) using a controller (164). A first electric motor (129) is driven using the controller based on the first angular position. A head (102) comprising at least one nozzle (104) is rotated to the first angular position responsive to driving a first electric motor. A second electric motor (162) is driven using the controller based on the first watering distance. A valve (160) is positioned in a first valve position responsive to driving a second electric motor. Water is discharged through the valve and the at least one nozzle. The head is held at the first angular position for a first time period based on the first watering distance.