Sub GPS_LocationChanged (Location1 As Location)
Lat1 = Location1.Latitude 'Get Lat
Long1 = Location1.Longitude 'Get GPS Long
Altitude = Location1.Altitude ' Get GPS Alt
GPSTime = Location1.Time ' Get GPS Time
'This next code just converts Lat Long to OSGB coordinates
Dim str As String
Dim digits As Int
Dim sep As String
OSGB.WGS84toOSGB36(Lat1, Long1, Altitude)
str = OSGB.OSGB36toNGR(OSGB.NewLatitude, OSGB.NewLongitude)
digits = 5
sep = " "
ngr = "GridRef: " & str.SubString2(0, 2) & sep & str.SubString2(2, digits + 2)
ngr = ngr & sep & str.SubString2(7, digits + 7) & CRLF
'Removes OSGB if outside UK
If Local = "English (United Kingdom)" Then
East = NumberFormat2(OSGB.Easting, 1, 0, 0, False)
North = NumberFormat2(OSGB.Northing, 1, 0, 0, False)
ngr = ngr & "National Grid: " & East & " " & North & CRLF
Else
East = 0
North = 0
End If
PicTime = dt.Format(GPSTime) ' Give the picture the UTC Date / time as picture name.
Log(PicTime)
camEx.TakePicture ' takes the picture
CSVWriter ' Writes a corresponding CSV file that links GPS to picture
End Sub