Rev 935 Rev 936
Line 1... Line 1...
1 // GPS skrysohledac 1 /**** GPS skrysohledac ****/
-   2 #define ID "$Id: gps.c 936 2008-01-02 22:01:37Z kakl $"
2   3  
3 #include "gps.h" 4 #include "gps.h"
4   5  
5 #include <math.h> 6 #include <math.h>
6 #include <stdlib.h> 7 #include <stdlib.h>
7 #include <stdlibm.h> 8 #include <stdlibm.h>
8   9  
9 #define LCD_RS PIN_B1 // LCD control 10 #define LCD_RS PIN_B1 // LCD control
10 #define LCD_E PIN_B0 // LCD enable 11 #define LCD_E PIN_B0 // LCD enable
11 #define LCD_DATA_LSB PIN_B4 // LSB data bit LCD 12 #define LCD_DATA_LSB PIN_B4 // LSB data bit LCD
12 #include "MYLCD.C" 13 #include "MYLCD.C"
13   14  
14 // NMEA 15 // NMEA
15 #define TIME 6 // For NMEA parsing 16 #define TIME 6 // For NMEA parsing
16 #define TIME_LEN 10 17 #define TIME_LEN 10
Line 88... Line 89...
88 while(TRUE) 89 while(TRUE)
89 { 90 {
90 const float gc_lat=49*60+12.4452,gc_lon=14*60+18.9079; // Testovaci souradnice: Cisticka 91 const float gc_lat=49*60+12.4452,gc_lon=14*60+18.9079; // Testovaci souradnice: Cisticka
91   92  
92 float bearing, heading, azim; 93 float bearing, heading, azim;
93 94  
94 read_NMEA(); // Read one NMEA line and parse 95 read_NMEA(); // Read one NMEA line and parse
95   96  
96 lon=(gc_lon-lon)*1214; // Kakona's projection :) 97 lon=(gc_lon-lon)*1214; // Kakona's projection :)
97 lat=(gc_lat-lat)*1854; 98 lat=(gc_lat-lat)*1854;
98   99