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

正文內(nèi)容

課程設(shè)計(jì)--基于單片機(jī)的小電阻測(cè)試儀-資料下載頁(yè)

2025-01-17 04:42本頁(yè)面
  

【正文】 oid Delay(unsigned int t) // delay 40us{ unsigned int i。 for(。t!=0。t) for(i=100。i!=0。i)。}void scankey(void)。void SendCommandByte(unsigned char ch){ RS=0。 RW=0。 P0=ch。 E=1。 Delay(1)。 E=0。 Delay(5)。 //delay 40us}void SendDataByte(unsigned char ch){ RS=1。 RW=0。 P0=ch。 E=1。 Delay(1)。 E=0。 Delay(5)。 //delay 40us}void InitLcd(){SendCommandByte(0x30)。 SendCommandByte(0x30)。 SendCommandByte(0x30)。 SendCommandByte(0x38)。 //設(shè)置工作方式 SendCommandByte(0x0c)。 //顯示狀態(tài)設(shè)置 SendCommandByte(0x01)。 //清屏 SendCommandByte(0x06)。 //輸入方式設(shè)置}void DisplayMsg1(uchar *p){ unsigned char count。 SendCommandByte(0x80)。 //設(shè)置DDRAM地址 for(count=0。countk。count++) {SendDataByte(*p++)。 }}//向液晶顯示器第一行發(fā)送數(shù)據(jù),由全局變量k決定發(fā)送長(zhǎng)度 void DisplayMsg2(uchar *p){ unsigned char count。 SendCommandByte(0xc0)。 //設(shè)置DDRAM地址 for(count=0。countk。count++) {SendDataByte(*p++)。 }}//向液晶顯示器第一行發(fā)送數(shù)據(jù),由全局變量k決定發(fā)送長(zhǎng)度 unsigned int Mid_Value(int c[]){ char i,j。 unsigned int buf。 for(i=0。i8。i++){ for(j=0。j8。j++){ if(c[j+1]c[j]){ buf=c[j+1]。 c[j+1]=c[j]。 c[j]=buf。 } } } return(c[4])。}main(){ int test[9]。 char i=0。 unsigned int mid。 TMOD=0x1D。 EA=0。 ET1=1。 TR1=1。 //定時(shí)器配置 InitLcd()。 //LCD1602初始化while(1){ for(i=0。i9。i++) //連續(xù)9次采樣{ while(INT0)。 while(!INT0)。 TR0=1。 while(INT0)。 TR0=0。 al=TL0。 ah=TH0。 TL0=0X00。 TH0=0X00。 ah=(ah*256+al)10002。 test[i]=ah。}mid=Mid_Value(test)。 //中值濾波if(mid19500){ SendCommandByte(0x01)。 k=10。 DisplayMsg1(overflow)。}else { //將脈沖數(shù)轉(zhuǎn)化為電阻并輸出顯示 mid=mid/2*5/48+B。 wan=mid/10000。 qian=(mid(wan*10000))/1000。 bai=(mid(mid/1000*1000))/100。 shi=(mid(mid/100*100))/10。 ge=mid%10。 SendCommandByte(0x01)。 bcd[1]=39。.39。 bcd[0]=qian+48。 bcd[2]=bai+48。 bcd[3]=shi+48。 bcd[4]=ge+48。 k=9。 DisplayMsg1(bcd)。} }
點(diǎn)擊復(fù)制文檔內(nèi)容
電大資料相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1