freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

基于單片機的行車記錄儀畢業(yè)論文-資料下載頁

2025-06-27 20:48本頁面
  

【正文】 FO *GPS)。int GPS_GGA_Parse(char *line,GPS_INFO *GPS)。void Int_To_Str(int x,char *Str)。static uchar GetComma(uchar num,char* str)。static double Get_Double_Number(char *s)。static float Get_Float_Number(char *s)。static void UTC2BTC(DATE_TIME *GPS)。void Show_Float(float fla, uchar x, uchar y)。//1602顯示void GPS_DispTime(void)。void GPS_DisplayOne(void)。void GPS_DisplayTwo(void)。void scan_key()。unsigned int key=1。uchar it=0。char xdata rev_buf[80]。 //接收緩存uchar xdata rev_start = 0。 //接收開始標(biāo)志uchar xdata rev_stop=0。 //接受停止標(biāo)志uchar xdata gps_flag = 0。 //GPS處理標(biāo)志uchar xdata change_page = 0。 //換頁顯示標(biāo)志uchar xdata num = 0。 uchar num2=0。GPS_INFO GPS。 //,使用時要加extern/*********************************************************************名稱:delay()*功能:延時,延時時間大概為140us* 無* 無***********************************************************************/void delay(){ int i,j。 for(i=0。 i=6。 i++) for(j=0。 j=10。 j++)。}/*********************************************************************名稱:enable(uchar del) *功能:1602命令函數(shù)*輸入:輸入的命令值*輸出:無***********************************************************************/void enable(uchar del){ P0 = del。 RS = 0。 RW = 0。 E = 0。 delay()。 E = 1。 //delay()。}/*********************************************************************名稱:write(uchar del)*功能:1602寫入數(shù)據(jù)函數(shù)*輸入:需要寫入1602的數(shù)據(jù)*無***********************************************************************/void write(uchar del){ P0 = del。 RS = 1。 RW = 0。 E = 0。 delay()。 E = 1。 //delay()。}/*********************************************************************名稱:L1602 init()*功能:1602初始化*輸入:無*輸出:無***********************************************************************/void L1602_init(void){ enable(0x01)。 enable(0x38)。 enable(0x0c)。 enable(0x06)。 enable(0xd0)。}/****************************************串口初始化/****************************************/void Uart_Init(void){ //SCON = 0x50。 PCON = 0x00。 TMOD=0x21。 TH0=0x3c。 TL0=0xb0。 TH1=0xfd。 TL1=0xfd。 //TR0=1。 //開啟定時器0 TR1=1。 REN=1。 //允許接收數(shù)據(jù) SM0=0。 SM1=1。 TI=0。 RI=0。 EA=1。 //開總中斷 ES=1。 //串口1中斷允許 ET0 = 1。 //定時器0中斷允許}/*********************************************************************名稱:L1602string(uchar hang,uchar lie,uchar *p)*功能:改變液晶中某位的值,如果要讓第一行,第五個字符開始顯示“ab cd ef”,調(diào)用該函數(shù)如下 L1602_string(1,5,ab cd ef。)*輸入:行,列,需要輸入1602的數(shù)據(jù)*輸出:無***********************************************************************/void L1602_string(uchar hang,uchar lie,uchar *p){ uchar a。 if(hang == 1) a = 0x80。 if(hang == 2) a = 0xc0。 a = a + lie 1。 enable(a)。 while(1) { if(*p == 39。\039。) break。 write(*p)。 p++。 }}//====================================================================////語法格式: void GPS_Init(void)//實現(xiàn)功能:GPS初始化,在LCD上顯示初始化信息//參數(shù):無//返回值:無//====================================================================//void GPS_Init(void){ L1602_string(1,2,The GPS Starts)。 L1602_string(2,2,GPS Searching!)。}//====================================================================//// 語法格式:int GPS_RMC_Parse(char *line, GPS_INFO *GPS) // 實現(xiàn)功能:把GPS模塊的GPRMC信息解析為可識別的數(shù)據(jù)// 參數(shù):存放原始信息字符數(shù)組、存儲可識別數(shù)據(jù)的結(jié)構(gòu)體// 返回值:// 1:解析GPRMC完畢// 0:沒有進(jìn)行解析,或數(shù)據(jù)無效//====================================================================//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 == 39。C39。) //如果第五個字符是C,($GPRMC) { if (status == 39。A39。) //如果數(shù)據(jù)有效,則分析,第二位,定位狀態(tài),A=有效定位,v=無效定位 { GPS NS = buf[GetComma(4, buf)]。 GPS EW = buf[GetComma(6, buf)]。 GPSlatitude = Get_Double_Number(amp。buf[GetComma(3, buf)])。 GPSlongitude = Get_Double_Number(amp。buf[GetComma( 5, buf)])。 GPSlatitude_Degree= (int)GPSlatitude / 100。 //分離緯度 lati_cent_tmp = (GPSlatitude GPSlatitude_Degree * 100) * 。 GPSlatitude_Cent = (int)lati_cent_tmp。 lati_second_tmp = (lati_cent_tmp GPSlatitude_Cent) * 60。 GPSlatitude_Second= (int)lati_second_tmp。 GPSlongitude_Degree = (int)GPSlongitude / 100。 //分離經(jīng)度 long_cent_tmp= (GPSlongitude GPSlongitude_Degree * 100) * 。 GPSlongitude_Cent = (int)long_cent_tmp。 long_second_tmp = (long_cent_tmp GPSlongitude_Cent) * 60。 GPSlongitude_Second = (int)long_second_tmp。 speed_tmp= Get_Float_Number(amp。buf[GetComma(7, buf)])。 //速度(單位:海里/時) GPSspeed= speed_tmp * 。 //1海里= GPSdirection = Get_Float_Number(amp。buf[GetComma(8, buf)])。 //角度 GPS = (buf[7] 39。039。) * 10 + (buf[8] 39。039。)。 //時間 GPS = (buf[9] 39。039。) * 10 + (buf[10] 39。039。)。 GPS = (buf[11] 39。039。) * 10 + (buf[12] 39。039。)。 tmp = GetComma(9, buf)。 GPS = (buf[tmp + 0] 39。039。) * 10 + (buf[tmp + 1] 39。039。)。 //日期 GPS= (buf[tmp + 2] 39。039。) * 10 + (buf[tmp + 3] 39。039。)。 GPS= (buf[tmp + 4] 39。039。) * 10 + (buf[tmp + 5] 39。039。)+2000。 UTC2BTC(amp。GPSD)。 return 1。 } } return 0。}//====================================================================////語法格式: int GPS_GGA_Parse(char *line, GPS_INFO *GPS)//實現(xiàn)功能:把GPS模塊的GPGGA信息解析為可識別的數(shù)據(jù)//參數(shù):存放原始信息字符數(shù)組、存儲可識別數(shù)據(jù)的結(jié)構(gòu)體//返回值:// 1:解析GPGGA完畢// 0: 沒有進(jìn)行解析,或數(shù)據(jù)無效//====================================================================//int GPS_GGA_Parse(char *line,GPS_INFO *GPS){ uchar ch, status。 char *buf = line。 ch = buf[4]。 status = buf[GetComma(2, buf)]。 if (ch == 39。G39。) //$GPGGA { if (status != 39。,39。) { GPSheight_sea = Get_Float_Number(amp。buf[GetComma(9, buf)])。 GPSheight_ground = Get_Float_Number(amp。buf[GetComma(11, buf)])。 return 1。 } } r
點擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1