Syncing this clock with GPS NMEA

Hello back,
I open this post, (I wish the last one for a long time :slight_smile: ) to ask you how to sync this clock sketch, with the hour given by a GPS module.

#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#include <SoftwareSerial.h>//incluimos SoftwareSerial

#define I2C_ADDR    0x3F // <<----- Add your address here.  Find it from I2C Scanner
#define BACKLIGHT_PIN     3
#define En_pin  2
#define Rw_pin  1
#define Rs_pin  0
#define D4_pin  4
#define D5_pin  5
#define D6_pin  6
#define D7_pin  7

unsigned long currentmicros = 0;
unsigned long nextmicros = 0;
unsigned long interval = 10000; // adjusted for my board

byte tens_hours = 1; 
byte ones_hours = 7;  
byte tens_minutes = 0;
byte ones_minutes = 8;
byte tens_seconds = 0;
byte ones_seconds = 0;
byte tenths = 0;
byte hundredths= 0;

byte prior_hundredths = 0;

LiquidCrystal_I2C  lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

void setup()
{
lcd.begin(20,4);//Iniciamos el puerto serie
lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);
lcd.setBacklight(HIGH);
lcd.home (); 
nextmicros = micros();
}

void loop()
{
  lcd.setCursor(0, 0);

  currentmicros = micros(); // read the time.

  if ((currentmicros - nextmicros) >= interval) // 10 milliseconds have gone by
  {
    hundredths = hundredths +1;

    if (hundredths == 10){
      hundredths = 0;
      tenths = tenths +1;
    }
    if (tenths == 10){
      tenths = 0;
      ones_seconds = ones_seconds +1;
    }
    if (ones_seconds == 10){
      ones_seconds = 0;
      tens_seconds = tens_seconds +1;
    }
    if (tens_seconds == 6){
      tens_seconds = 0;
      ones_minutes = ones_minutes +1;
    }
    if (ones_minutes == 10){
      ones_minutes = 0;
      tens_minutes = tens_minutes +1;
    }
    if (tens_minutes == 6){
      tens_minutes = 0;
      ones_hours = ones_hours +1;
    }
    if (ones_hours == 10){
      ones_hours = 0;
      tens_hours = tens_hours +1;
    }
    if ((tens_hours == 2) && (ones_hours == 4)){
      ones_hours = 0;
      tens_hours = 0;
      delay(1000);
    }
    nextmicros = nextmicros + interval; 
  }  

  if (prior_hundredths != hundredths){
    lcd.setCursor(0,0);
    lcd.print(tens_hours, DEC);
    lcd.print(ones_hours, DEC);
    lcd.print(":");
    lcd.print(tens_minutes, DEC);
    lcd.print(ones_minutes, DEC);
    lcd.print(":");
    lcd.print(tens_seconds, DEC);
    lcd.print(ones_seconds, DEC);
    lcd.print (":");
    lcd.print(tenths, DEC);
    lcd.print(hundredths, DEC);
    prior_hundredths = hundredths;   
   
  }  

}

EDIT: I don't want to sync the clock every second, or something like that, I just want to set the clock with the time given by the GPS when the arduino starts up.

It is rather a difficult task to sync the clock to the GPS time. It is easier to just display the GPS time.

Yes, but it doesn't show hundredths as well as GPS.
I just want the NMEA to set the time when the Arduino starts up, and if it were possible to sync it every 30 minutes.

Considering your other post in this forum, this is far beyond your programming skills. Keep working at it, though!

How many threads are you going to open on this topic? This is at least the third within 24 hours.