Code:
const fixed  TICKS_PER_HOUR = 16 * 60 * 60;

while (1)
{
  my->pan = (total_ticks % TICKS_PER_HOUR) * 360 / TICKS_PER_HOUR;
  wait(1);
}



Just another suggestion.


Always learn from history, to be sure you make the same mistakes again...