Need some help with my code ,please

With the for loops i am trying to move the servo, from centered position, either clockwise or anticlockwise

Although your code makes much much much more sense, i dont think it adresses the issue of the temperature spikes :confused: