Code to schedule and control sprinklers