' PMK-GPS v1.0 (19-July-2023) ' George Heron N2APB ' Simple demo program run on the PMK with Shield 2 containing ' an OLED and GPS board, used to display GPS data to display. ' ******************************************************** MM.Startup SetPin GP1,GP0,COM1 ' Setup for the GPS board Open "COM1:" As GPS,-4 ' EDT (-4), EST (-5) SetPin GP22,INTH,PPSisr, PULLUP ' Setup for 1pps ISR CLS Text 0,0,"GPS CONTROLLER " Text 00,15,"(Syncing)" ' Disply "Syncing" until overwritten by 1pps ISR Do While (1=1) ' Wait here in between 1pps interrupts Loop '----------- 1pps ISR ------------- Sub PPSisr If GPS(VALID) Then Date$ = GPS(Date) ' Get current Date and display it Text 0,15,"Dat:" Text 40,15,Date$ Time$ = GPS(Time) ' Get current Time and display it Text 0,28,"Tim:" Text 40,28,Time$ Lat = GPS(Latitude) ' Get Latitude and display it Latstring$ = (Format$(Lat,"%.2f")) Text 0,41,"Lat:" Text 40,41,Latstring$ Lon = GPS(Longitude) ' Get Longitude and display it Lonstring$ = (Format$(Lon,"%.2f")) Text 0,54,"Lon:" Text 40,54,Lonstring$ EndIf End Sub '****************** Sub MM.STARTUP Option DISPLAY 60,100 End Sub