From fd1f3aa14dbb65765950bd0b6a39928b15b513ba Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 6 Apr 2023 20:00:58 -0400 Subject: [PATCH] check range of lat and lon --- main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index c56d4a28..3affeb9f 100644 --- a/main.c +++ b/main.c @@ -730,11 +730,13 @@ int main(int argc, char * argv[]) { } } printf("\n"); - if (sensor[XS1] != 0) { +// if (sensor[XS1] != 0) { + if ((sensor[XS1] > -90.0) && (sensor[XS1] < 90.0)) { latitude = toAprsFormat(sensor[XS1]); printf("Latitude updated to %f \n", latitude); } - if (sensor[XS2] != 0) { +// if (sensor[XS2] != 0) { + if ((sensor[XS2] > -180.0) && (sensor[XS2] < 180.0)) { longitude = toAprsFormat(sensor[XS2]); printf("Longitude updated to %f \n", longitude); }