step motor or servo motor that moves every so often

good morning companions,
I would like to know if it is possible for a stepper motor to work every "x" time, that is; that every 4 hours make a 180 ° movement.

Thank you for your cooperation I will be attentive to your answers.

Yes.

Edit - while that exactly answered your question, I have to add. Stepper motors draw current all the time. They may or may not be the best solution for you for that and any number of other reasons. But you need to tell us more about what you are trying to do.

Yes, tell us what you are trying to do, not how you think it should be done, otherwise we are in xy problem
territory yet again: xyproblem.info