GPS
Fork of GPS by
Diff: GPS.cpp
- Revision:
- 3:5cb504ce2793
- Parent:
- 2:dcc14e81f8be
- Child:
- 4:9ac674d05370
--- a/GPS.cpp Sat Oct 13 04:27:18 2012 +0000 +++ b/GPS.cpp Sun Oct 21 09:28:41 2012 +0000 @@ -27,6 +27,61 @@ degrees = trunc(longitude / 100.0f); minutes = longitude - (degrees * 100.0f); longitude = degrees + minutes / 60.0f; + if(fixtype == 1) { + fix = "Positive"; + } + if(fixtype == 2) { + fix = "Differential"; + } + if(heading > 0.00 && heading < 45.00) { + cardinal = "NNE"; + } + if(heading == 45.00) { + cardinal = "NE"; + } + if(heading > 45.00 && heading < 90.00) { + cardinal = "ENE"; + } + if(heading == 90.00) { + cardinal = "E"; + } + if(heading > 90.00 && heading < 135.00) { + cardinal = "ESE"; + } + if(heading == 135.00) { + cardinal = "SE"; + } + if(heading > 135.00 && heading < 180.00) { + cardinal = "SSE"; + } + if(heading == 180.00) { + cardinal = "S"; + } + if(heading > 180.00 && heading < 225.00) { + cardinal = "SSW"; + } + if(heading == 225.00) { + cardinal = "SW"; + } + if(heading > 225.00 && heading < 270.00) { + cardinal = "WSW"; + } + if(heading == 270.00) { + cardinal = "W"; + } + if(heading > 270.00 && heading < 315.00) { + cardinal = "WNW"; + } + if(heading == 315.00) { + cardinal = "NW"; + } + if(heading > 315.00 && heading < 360.00) { + cardinal = "NNW"; + } + if(heading == 360.00 || heading == 0.00) { + cardinal = "N"; + } + kph = speed*1.852; return 1; } }