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

正文內(nèi)容

基于單片機的gps定位系統(tǒng)設(shè)計本科畢業(yè)論文-資料下載頁

2025-06-27 19:46本頁面
  

【正文】 clude stc\void LCD1602_WriteCMD(unsigned char mand)。 //寫命令指令void LCD1602_WriteData(unsigned char dat)。 //寫數(shù)據(jù)指令void LCD1602_SetCursor(unsigned char x, unsigned char y)。 //設(shè)置顯示地址void LCD1602_PutChar(unsigned x,unsigned char y,unsigned char dat)。 //寫一個字符void LCD1602_PutStr(unsigned char x,unsigned char y,unsigned char *s)。 //寫一個字符串void LCD1602_PutNum(unsigned char x,unsigned char y,unsigned int intdat)。 //寫無字符型整形數(shù)void LCD1602_Init(void)。 //初始化void LCD1602_CheckBusy(void)。 //LCD讀忙信號void LCD1602_Clear(void)。 //清屏void Delay(void)。 //@sbit LCD1602_BLK=P1^2。 //LCD背光,低電平使能endifinclude include //include stcKU\debug\define MSB 0x80 //讀忙位define LCDIO P0 //LCD1602的高四位接在P2口的高四位sbit LCD1602_RS=P1^7。 //RS為寄存器選擇,高電平時選擇數(shù)據(jù)寄存器、低電平時選擇指令寄存器。sbit LCD1602_RW=P1^6。 //RW為讀寫信號線,高電平時進行讀操作,低電平時進行寫操作。sbit LCD1602_EN=P1^5。 //E端為使能端,當E端由高電平跳變成低電平時,液晶模塊執(zhí)行命令。define CMD_CLEAR 0x01void Delay(void) //@{ unsigned char i, j。 i=8。//i = 8。 j=40。//j = 35。 do { while (j)。 } while (i)。}//LCD的初始化函數(shù)void LCD1602_Init(void){ LCD1602_WriteCMD(0x38)。 //28設(shè)置四位數(shù)據(jù)線模式0c設(shè)置八位數(shù)據(jù)線模式 LCD1602_WriteCMD(0x0c)。 //開顯示命 原0c// LCD1602_WriteCMD(0x0f)。 //設(shè)置首地址 LCD1602_WriteCMD(0x80)。 LCD1602_Clear()。 //清屏 LCD1602_BLK=0。}//清屏函數(shù)void LCD1602_Clear(void){ LCD1602_WriteCMD(CMD_CLEAR)。 //清屏命令}//檢測忙信號void LCD1602_CheckBusy(void){ LCD1602_RS=0。 LCD1602_RW=1。 LCD1602_EN=1。 _nop_()。 while(LCDIOamp。MSB) { LCD1602_EN=0。 _nop_()。 LCD1602_EN=1。 _nop_()。 } }//開始寫void LCD1602_WriteStart(void) //EN端產(chǎn)生一個高電平脈沖,寫LCD{ LCD1602_EN=1。 Delay()。 LCD1602_EN=0。 }//寫命令void LCD1602_WriteCMD(unsigned char mand){ LCD1602_CheckBusy()。 LCDIO=mand。 LCD1602_RS=0。 //RS 0 寫命令 LCD1602_RW=0。 //RW 0 Delay()。 LCD1602_WriteStart()。}//寫數(shù)據(jù)void LCD1602_WriteData(unsigned char dat){ LCD1602_CheckBusy()。 LCDIO=dat。 LCD1602_RS=1。 //RS 1 寫數(shù)據(jù) LCD1602_RW=0。 //RW 0 Delay()。 LCD1602_WriteStart()。}//設(shè)置顯示地址:X為橫軸(015),Y為縱軸(01)void LCD1602_SetCursor(unsigned char x,unsigned char y){ unsigned char address。 xamp。=0x0f。 if(!y) address=0x80+x。 else address=0xc0+x。 LCD1602_WriteCMD(address)。 }//寫一個字符:X為橫軸(015),Y為縱軸(01)void LCD1602_PutChar(unsigned x,unsigned char y,unsigned char dat){ LCD1602_SetCursor(x,y)。 LCD1602_WriteData(dat)。}//寫一個字符串:X為橫軸(015),Y為縱軸(01)void LCD1602_PutStr(unsigned char x,unsigned char y,const unsigned char *s){ LCD1602_SetCursor(x,y)。 while(*s) { LCD1602_WriteData(*s)。 s++。 }}//寫一個無字符整數(shù):X為橫軸(015),Y為縱軸(01)void LCD1602_PutNum(unsigned char x,unsigned char y,unsigned int num){ unsigned char i=0,temp[5]。 while(num/10 || num%10) { temp[i]=num%10。 num/=10。 i++。 } LCD1602_SetCursor(x,y)。 while(i) { i。 LCD1602_WriteData(temp[i]+0x30)。 }}ifndef _instruct_init__Hdefine _instruct_init__Hinclude stc\include extern unsigned char Ex0_flag。extern unsigned char Ex1_flag。unsigned char zjval。//中間值extern ST_FIFO_BUF GPS_data。extern unsigned char rcvbuf[600]。void Delay10ms() //@{ unsigned char i, j, k。 i = 1。 j = 180。 k = 71。 do { do { while (k)。 } while (j)。 } while (i)。}/*外部中斷0下降沿觸發(fā)*/void INT0_Init(){ IT0=1。 EX0=1。//中斷允許}/*外部中斷1下降沿觸發(fā)*/void INT1_Init() { IT1=1。 EX1=1。}/*串口2 ,960081*///9600bps@void UART1_Init(void) //9600bps@{ SCON = 0x50。 //8, AUXR |= 0x40。 //1 Fosc, 1T AUXR amp。= 0xFE。 //1 1 TMOD amp。= 0x0F。 //1 16 TL1 = 0x20。 // TH1 = 0xFE。 // ET1 = 0。 //1 TR1 = 1。 //1}/*串口2 ,960081*///9600bps@void UART2_Init(void) { S2CON = 0x50。 //8 AUXR |= 0x04。 //Fosc,1T T2L = 0x20。 // T2H = 0xFE。 // AUXR |= 0x10。 //2 IE2|=0X01。 //中斷允許 EA=1。}/*串口 1 發(fā)送函數(shù)*/void uart1_send(unsigned char r1send){ SBUF=r1send。 while(!TI)。 TI=0。}/*串口 2 發(fā)送函數(shù)*/void uart2_send(unsigned char r2send){ S2BUF=r2send。 while(!S2CONamp。0X02)。 S2CONamp。=0XFD。}/*中斷服務(wù)函數(shù)*/void INT0_Suv() interrupt 0{ EX0=0。//中斷允許 Delay10ms()。 while(~P32)。 Delay10ms()。 Ex0_flag=~Ex0_flag。 EX0=1。//中斷允許}void INT1_Suv() interrupt 2{ EX1=0。//中斷允許 Delay10ms()。 while(~P33)。 Delay10ms()。 Ex1_flag=~Ex1_flag。 EX1=1。//中斷允許}void UART1_Suv() interrupt 4{。}void UART2_Suv() interrupt 8{ //if(S2CONamp。0X02)//TRANSLATe //{S2CONamp。=0XFD。} if(S2CONamp。0X01)//RECEIVE { S2CONamp。=0XFE。 zjval=S2BUF。//GPS_data。 FIFO_BUF_Write(amp。GPS_data,zjval)。 //uart1_send(zjval)。 }。}endif35
點擊復(fù)制文檔內(nèi)容
畢業(yè)設(shè)計相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1