Go Down

Topic: Simple analog clock (Read 1 time) previous topic - next topic


Hello guys,

   I'm kinda new to programing, and i was wondering if you can help me.
   Basically i'm trying to make a clock using a micro servo. The servo has to do the 180 degrees of range in 12 hours and then return to initial position again.
   I've been using the exemple "sweep" by changing the delays, but it moves once every 6 minutes only, is it possible to make the servo advance very slowly continuously as the hour pointer does in a normal analog clock?

Thanks in advance,


I've been using the exemple "sweep"

Link please.

You can use smaller increments rather than longer delays.


the smallest inscrement possile is 1, can i use the map function or something similar?


The servo library doesn't take fractional angles.
Have you tried the library's writeMicroseconds  method?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.


i haven't tried it yet because i didn't about it, could you give an exemple, or tell me where i could learn more about it?



   Thank you for your answers, it works ery good with the writeMicroseconds


if you want to save battery/power, i see no reason you need to keep sending pulses between movements, since the servo should hold its position on its own, right?  Just move it to where it needs to be, then don't pulse again till the hand needs to increment.

Go Up