Question about the time library

Hi all,
i am trying to programm a clock with my Arduino. But i am not really understanding how the time library works.
Here is the code i have written.

#include <Time.h>
#include <TimerOne.h>


int tilt = A5;
int mts = 0;
int hrs = 0;
int scd = 0;

void setup()
{
  pinMode(tilt, 0);
  pinMode(10, 0);
  Timer1.initialize(300);         // initialize timer1
  Timer1.pwm(10, 512);                // setup pwm pin 10 / 50%
  setTime(hrs,mts,scd,0,0,0);
}
 
 
void loop()
{
  delay(50);
  int tilt_x = analogRead(tilt);
  if (tilt_x > 500) {
    pulse();
  }
  else {
      Timer1.disablePwm(10);
  }
  
  Serial.begin(9600);
  Serial.print(scd);
  Serial.print("\n");
  Serial.print(mts);
  Serial.print("\n");
  Serial.print(hrs);
  Serial.print("\n");

}

void pulse() {
   Timer1.pwm(10, 512);                // set pwm on pin 10, 50% duty cycle
}

So I don't know hot to get the timer work.
I wan't to set the time into the variables.

Are you asking about the Time library or the TimerOne library?

You are setting the time to 00:00:00, which seems useless. Then, you never read the time, so mts, hrs, and scd will never change.

I am talking about the time library. Yes, I set it to 0:0:0.
Then I want to let it count the seconds (scd) minutes (mts) and hours (hrs).

Why does it not count them?

Why does it not count them?

It does. You just never ask it to tell you the new values.

The setTime function doesn't create references to your hrs,mts,scd variables, it just takes their value which is 0, you need to call the functions hour(),minute(),second() to find the current time.

Thanks a lot! I was wondering why there wasn't any data in the Variables!