Close

10-23-2022 - Clock homing

A project log for Making a literal digital clock

This is the start of a bigger project, splitting it up in different pieces. Sit back and relax, its gonna take some time ;-)

flamefireflamefire 10/23/2022 at 02:030 Comments

This log covers a software test, about homing the minute and hour pointers to accurate time.

The test includes:

  - Connecting to the internet (Earlier test)
  - Setting the RTC time (Earlier test)
  - Convert time into 12 hour format, then into 360 degrees format

      This was pretty easy, by subtracting 12 hours we can get it in 12 hour format, and then by multiplying hours with 30 and minutes with 6 we get it in the "unit circle"            format of degrees. With other words, represented as a circle...      

  - Run motors until destination is reached

      Basically a function that gets the hours and minutes in degrees, then sets the motor "wanted" position. Starts while loop, that runs motors and breaks when BOTH            motors has reached its destination. It sounds so easy when written. Also we remember that we cant just set the hour pointer at 02 O'clock, when the minute pointer        is at 55 minutes. The hour pointer is also dependent on the minutes.

The result:

Console output:

Console output

Next I would like it to be a little more smooth and accurate, it seems a little off somehow with the minutes.

Also next is the last important step, making the pointers go around ... smooooothly.

Discussions