Help with some programming!!

It executes once: that is it goes from 0 degrees to 180 degrees and back to 0 degrees