77
88#include "NMEAParser.h"
99#include "SerialDebug.h"
10+ #include "SoftSerial.h"
1011#include "LCD.h"
1112
1213#include <util/delay.h>
@@ -16,6 +17,7 @@ int main(void)
1617{
1718 LCDInit ();
1819 SerialDebugInitWithBaudRate (9600 );
20+ SoftSerialInit ();
1921 double distance = 0.0f ;
2022 NMEAData initLocation , prevData ;
2123 initLocation .isValid = 0 ;
@@ -32,7 +34,7 @@ int main(void)
3234
3335 if (!initLocation .isValid )
3436 {
35- SerialDebugPrint ("Failed initial parsed message: %s" , gps_msg );
37+ SoftSerialPrintLn ("Failed initial parsed message: %s" , gps_msg );
3638 }
3739 }
3840
@@ -50,22 +52,22 @@ int main(void)
5052
5153 if (gpsData .isValid && parseResult == 0 )
5254 {
53- SerialDebugPrint ("Parse succeeds, message %s" , gps_msg );
54- SerialDebugPrint ("lat %d %lf" , gpsData .location .lat_deg ,
55+ SoftSerialPrintLn ("Parse succeeds, message %s" , gps_msg );
56+ SoftSerialPrintLn ("lat %d %lf" , gpsData .location .lat_deg ,
5557 gpsData .location .lat_min );
56- SerialDebugPrint ("lon %d %lf" , gpsData .location .lon_deg ,
58+ SoftSerialPrintLn ("lon %d %lf" , gpsData .location .lon_deg ,
5759 gpsData .location .lon_min );
5860
5961 distance += NMEAGetDistance (& prevData .location , & gpsData .location );
60- SerialDebugPrint ("traveled distance %.2lf m" , distance );
62+ SoftSerialPrintLn ("traveled distance %.2lf m" , distance );
6163
6264 double angle = NMEAGetAngle (& initLocation .location , & gpsData .location );
63- SerialDebugPrint ("angle from initial location %.2lf degrees" , angle );
65+ SoftSerialPrintLn ("angle from initial location %.2lf degrees" , angle );
6466
6567 double distanceToInitPlace = NMEAGetDistance (& initLocation .location , & gpsData .location );
66- SerialDebugPrint (" %4.0lf m to initial place" , distanceToInitPlace );
68+ SoftSerialPrintLn (" %4.0lf m to initial place" , distanceToInitPlace );
6769
68- SerialDebugPrint (" " );
70+ SoftSerialPrintLn (" " );
6971
7072 LCDSetCursor (1 ,0 );
7173 LCDPrint ("traveled %.2lf m" , distance );
0 commit comments