![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Fork with SeeedStudio Xadow GPS v2 enabled
Dependencies: FXOS8700CQ MODSERIAL XadowGPS mbed
Fork of Avnet_ATT_Cellular_IOT by
Diff: sensors.cpp
- Revision:
- 72:b500e1507b5f
- Parent:
- 71:45a5e426df81
- Child:
- 77:c65eae5b9958
--- a/sensors.cpp Thu Aug 11 17:04:09 2016 +0000 +++ b/sensors.cpp Thu Aug 11 21:14:32 2016 +0000 @@ -475,14 +475,14 @@ void Read_GPS() { - unsigned char gps_valid = 0; //default + unsigned char gps_satellites = 0; //default int lat_sign; int long_sign; if (bGPS_present) { if ((gps_get_status() == 'A') && (gps_get_mode2() != '1')) { - gps_valid = 1; + gps_satellites = gps_get_sate_in_veiw(); //show the number of satellites } if (gps_get_ns() == 'S') { @@ -501,14 +501,14 @@ long_sign = 1; } #if (0) - PRINTF("gps_valid : %d\r\n", gps_valid); + PRINTF("gps_satellites : %d\r\n", gps_satellites); PRINTF("gps_get_latitude : %f\r\n", (lat_sign * gps_get_latitude())); PRINTF("gps_get_longitude : %f\r\n", (long_sign * gps_get_longitude())); PRINTF("gps_get_altitude : %f meters\r\n", gps_get_altitude()); PRINTF("gps_get_speed : %f knots\r\n", gps_get_speed()); PRINTF("gps_get_course : %f degrees\r\n", gps_get_course()); #endif - sprintf(SENSOR_DATA.GPS_Valid, "%d", gps_valid); + sprintf(SENSOR_DATA.GPS_Satellites, "%d", gps_satellites); sprintf(SENSOR_DATA.GPS_Latitude, "%f", (lat_sign * gps_get_latitude())); sprintf(SENSOR_DATA.GPS_Longitude, "%f", (long_sign * gps_get_longitude())); sprintf(SENSOR_DATA.GPS_Altitude, "%f", gps_get_altitude());