Re: Arduino Clock code

The clock function gets called every 20 milliseconds. That's how frequently the servo needs a pulse to make it hold it's position.

Every 50 passes through the function, it updates secs, mins, and hour. That works out to one a second, which is good for a clock.

Then, it reads some switch pins to determine what is to be displayed on the clock. If the Set_mins pin is LOW, the display is to be updated in 1/2 minute increments. If Set_hours is LOW, the display is to be updated in 1/2 hour increments. If Disp_secs is LOW, the display is to be updated every second.

Since you have no switches, but the pull up resistors are enabled, the Set_mins, Set_hours, and Disp_secs pins will always be HIGH, and the display (servo position) should be updated one a minute.

At the moment when I upload this code it just makes the servo "tick" for 60 seconds before returning to the beginning again and repeating the process

What do you mean by "tick" for 60 seconds? Does the servo sweep a complete circle, or part of a circle? Do you have a 180 degree servo or a continuous rotation servo?

Why do we keep getting random post replies with no first post?

Someone posting wrong or someone deleting posts?

Mowcius

someone deleting posts

The author deleted the post.

sorry I was trying to delete the whole post but I couldn't work out how to do it.

But why would you want to delete whole threads? Forums provide a great searchable database of information for future visitors and solution-seekers.