基于51单片机GPS定位系统设LCD12864显示(程序+原理图+PCB+论文)

资料编号:202

功能介绍:

(1).定位功能

GPS通过接收卫星信号,可以准确地定出其所在的位置,位置误差小于10米。利用GPS,在12864上面显示当前位置。

(2).查询时间功能

GPS还可以接收卫星发下来的时间信息,利用单片机控制12864显示出当前时间,用户可以很方便的了解时间。

总体设计方案

个人手持设备要求是功耗要足够低、操作简单、界面美观、方便观看。为完成相应功能,本设计提出的方案如图1.1所示。系统包括以下几个基本模块:电源模块、主控模块、显示模块、GPS定位模块。GPS模块负责接收卫星信息,单片机模块负责读取GPS模块数据并处理,显示模块主要负责将GPS模块接收到的数据显示出来供用户随时观看。

图1.1 系统结构框图

 

部分程序展示:

int GPS_RMC_Parse(char *line,GPS_INFO *GPS)
{
    uchar ch, status, tmp;
    float lati_cent_tmp, lati_second_tmp;
    float long_cent_tmp, long_second_tmp;
    float speed_tmp;
    char *buf = line;
    ch = buf[5];
    status = buf[GetComma(2, buf)];

    if (ch == 'C')  //如果第五个字符是C,($GPRMC)
    {
        if (status == 'A')  //如果数据有效,则分析
        {
            GPS -> NS       = buf[GetComma(4, buf)];
            GPS -> EW       = buf[GetComma(6, buf)];

            GPS->latitude   = Get_Double_Number(&buf[GetComma(3, buf)]);
            GPS->longitude  = Get_Double_Number(&buf[GetComma( 5, buf)]);

               GPS->latitude_Degree  = (int)GPS->latitude / 100;       //分离纬度
            lati_cent_tmp         = (GPS->latitude - GPS->latitude_Degree * 100);
            GPS->latitude_Cent    = (int)lati_cent_tmp;
            lati_second_tmp       = (lati_cent_tmp - GPS->latitude_Cent) * 60;
            GPS->latitude_Second  = (int)lati_second_tmp;

            GPS->longitude_Degree = (int)GPS->longitude / 100;    //分离经度
            long_cent_tmp         = (GPS->longitude - GPS->longitude_Degree * 100);
            GPS->longitude_Cent   = (int)long_cent_tmp;    
            long_second_tmp       = (long_cent_tmp - GPS->longitude_Cent) * 60;
            GPS->longitude_Second = (int)long_second_tmp;

            speed_tmp      = Get_Float_Number(&buf[GetComma(7, buf)]);    //速度(单位:海里/时)
            GPS->speed     = speed_tmp * 1.85;                           //1海里=1.85公里
            GPS->direction = Get_Float_Number(&buf[GetComma(8, buf)]); //角度            

            GPS->D.hour    = (buf[7] - '0') * 10 + (buf[8] - '0');        //时间
            GPS->D.minute  = (buf[9] - '0') * 10 + (buf[10] - '0');
            GPS->D.second  = (buf[11] - '0') * 10 + (buf[12] - '0');
            tmp = GetComma(9, buf);
            GPS->D.day     = (buf[tmp + 0] - '0') * 10 + (buf[tmp + 1] - '0'); //日期
            GPS->D.month   = (buf[tmp + 2] - '0') * 10 + (buf[tmp + 3] - '0');
            GPS->D.year    = (buf[tmp + 4] - '0') * 10 + (buf[tmp + 5] - '0')+2000;

            UTC2BTC(&GPS->D);
            
            return 1;
        }        
    }
    
    return 0;
}

 

 

下面是该资料的分享下载链接:

https://pan.baidu.com/s/18_l8Yn95WZUnjjyEsP0Hug?pwd=q8iu 

  • 5
    点赞
  • 43
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值