Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbos Watchdog TextLCD mbed ConfigFile
Task6Pc.cpp
00001 #include "Task6Pc.h" 00002 00003 void ShowPcTask(void) 00004 {/** 00005 *\brief TASK 6, if a PC is connected, debug information can be sent to the console 00006 */ 00007 static int it = 0; 00008 int i; 00009 DegMinSec DecCoord; 00010 00011 os.SetTimer(SHOW_PC_TMR, 1000, 1000); 00012 while(1) 00013 { 00014 os.WaitEvent(SHOW_PC_EVT); 00015 00016 if(pc.readable()) 00017 {// wait for an input 00018 PcMonitor = (pc.getc()-48); // digit a number to en/dis-able debug 00019 } 00020 00021 if( PcMonitor==1 || PcMonitor>5) 00022 {// Display Info parameters 00023 pc.printf( 00024 "%03d, Lat: %f, Lon: %f, Sig:%d, Fix:%d, Inuse:%d\r\n", 00025 it++, latitude, longitude, info.sig, info.fix, info.satinfo.inuse ); 00026 for (i = 0; i < NMEA_MAXSAT; i++) 00027 { 00028 if (info.satinfo.sat[i].sig > 0) 00029 pc.printf(" sat_id:%02d, sig:%02d, Inuse:%d\r\n", 00030 info.satinfo.sat[i].id , info.satinfo.sat[i].sig, 00031 info.satinfo.sat[i].in_use); 00032 } 00033 pc.printf("\r\n"); 00034 } 00035 00036 if( PcMonitor==2 || PcMonitor>5) 00037 {// Display Distance parameters 00038 Deg2DegMinSec(nmea_radian2degree(Pos[0].lat), &DecCoord); 00039 pc.printf("Lat1:%d %d\'%.3f\" ", DecCoord.Deg, DecCoord.Min, DecCoord.Sec); 00040 Deg2DegMinSec(nmea_radian2degree(Pos[0].lon), &DecCoord); 00041 pc.printf("Lon1:%d %d\'%.3f\" ", DecCoord.Deg, DecCoord.Min, DecCoord.Sec); 00042 Deg2DegMinSec(nmea_radian2degree(Pos[1].lat), &DecCoord); 00043 pc.printf("Lat2:%d %d\'%.3f\" ", DecCoord.Deg, DecCoord.Min, DecCoord.Sec); 00044 Deg2DegMinSec(nmea_radian2degree(Pos[1].lon), &DecCoord); 00045 pc.printf("Lon2:%d %d\'%.3f\" \n", DecCoord.Deg, DecCoord.Min, DecCoord.Sec); 00046 pc.printf("Dist:%f Azimuth Start:%f Azimuth Final:%f \n\n", 00047 Path.Dist, Path.Azimuth[0], Path.Azimuth[1]); 00048 } 00049 } 00050 }
Generated on Thu Jul 14 2022 14:06:47 by
1.7.2