Better initial code for proving my zero crossing detector and triac driver