Timepulse Interrupt
Synchronize your application to the PPS signal from the GNSS module.
Source: examples/CPP/TimepulseInterrupt/, examples/C/TimepulseInterrupt/, examples/Python/timepulse_interrupt.py
hat->enableTimepulse();
while (true)
{
hat->timepulse(); // blocks until next PPS
auto nav = hat->navigation();
printf("PPS: %s\n",
Utils::utcTimeFromGnss_ISO8601(nav.pvt).c_str());
}
hat->disableTimepulse();
hat.enable_timepulse()
while True:
hat.timepulse() # blocks until next PPS
nav = hat.get_navigation()
print(f"PPS: {gnsshat.utc_time_iso8601(nav)}")
hat.disable_timepulse()
python3 examples/Python/timepulse_interrupt.py
NoteDo not use this example simultaneously with kernel PPS (/dev/pps0) — both claim GPIO 5.