PROGRAM: GPS 'Program to read position data from a Garmin GPS45XL and display it on 'a Scott Edwards 4 X 20 LCD display at 9600 baud. ' 'Program modified from a program written by Decade Engineering 'to work with the Garmin and LCD display. ' No guarantees this will work with your stuff and please no comments 'on my (lack of) programming style, I'm a truck driver, so gimme a break!! ' ' ' ***** Scott Edwards 4X20 LCD control codes ***** Home_Cursor CON 01 'Home the display cursor Big_Numbers CON 02 'Start big number display Blank_Cursor CON 04 'Turn off cursor Underline_Cursor CON 05 'Underline cursor Blink_Blk_Cursor CON 06 'Blinking block cursor Back_Space CON 08 'Back space the cursor Line_Feed CON 10 'Move down one row Vertical_Tab CON 11 'Move up one row Clear_Screen CON 12 'Clear the screen (Form feed) Carriage_Return CON 13 'Return to start of next line Lite_On CON 14 'Turn backlight on Lite_Off CON 15 'Turn backlight off Position_Cursor CON 16 'Position cursor at xxx Clear_Column CON 17 'Clear a column Display_Pin CON 00 'LCD display pin N9600 CON $4054 'LCD Baudrate (9600,n,8,1) GPS_Pin CON 15 'GPS data input pin N4800 CON 16572 'GPS baudrate (4800) time var byte(6) 'Unformatted time: 154533= 15:45:33 UTC latA var byte(4) 'Unformatted lat: 4416 = 44 degrees 16 min latB var byte(2) 'Unformatted lat decimal mins. 12 (above = 44 16.12) lonA var byte(5) 'Same format as Lat lonB var byte(2) 'Ditto Cse var byte(3) 'Whole number course (no decimal) Spd var byte(3) 'Whole number speed in kts.(no decimal) status var byte 'GPS status, A = good data, V = bad data id: serout Display_Pin,N9600, [Clear_Screen] pause 100 serout Display_Pin,N9600, [Position_Cursor,65,"K7FQ"] get_data: serin GPS_Pin,N4800,2000,no_data,[wait("GPRMC,"),str time\6,skip 1,status,skip 1,str latA\4,skip 1,str latB\2,skip 4,str lonA\5,skip 1,str lonB\2,skip 4,str Spd\3,skip 3,str Cse\3] serout Display_Pin,N9600, [Position_Cursor,71,time(0),time(1), ":",time(2),time(3), ":",time(4),time(5)," UTC"] if status="A"then good_fix if status="V"then bad_fix goto get_data bad_fix: serout Display_Pin,N9600, [Position_Cursor,86," "] 'Clear all data from screen so as not to display serout Display_Pin,N9600, [Position_Cursor,104," BAD FIX "]'garbage data serout Display_Pin,N9600, [Bell,Position_Cursor,126," "] goto get_data good_fix: serout Display_Pin,N9600, [Position_Cursor, 86,"LAT ",latA(0),latA(1)," ",latA(2), latA(3),".",latB(0), latB(1), " N"] serout Display_Pin,N9600, [Position_Cursor,106,"LON ", lonA(0),lonA(1), lonA(2)," ",lonA(3), lonA(4),".",lonb(0),lonB(1)," W"] serout Display_Pin,N9600, [Position_Cursor,125,"Cse: ",Cse(0),Cse(1),Cse(2)," Spd: ",Spd(0),Spd(1),Spd(2)] goto get_data no_data: serout Display_Pin,N9600,[Bell,Position_Cursor,125," NO SERIAL DATA "] goto get_data