xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

資源簡(jiǎn)介

超聲波測(cè)距及報(bào)警程序 可應(yīng)用于汽車倒車、建筑施工工地以及一些工業(yè)現(xiàn)場(chǎng)的位置監(jiān)控,也可用于如液位、井深、管道長(zhǎng)度的測(cè)量等場(chǎng)合。要求測(cè)量范圍在0.10~4.00m,測(cè)量精度1cm,測(cè)量時(shí)與被測(cè)物體無(wú)直接接觸,能夠清晰穩(wěn)定地顯示測(cè)量結(jié)果。

資源截圖

代碼片段和文件信息

#include?
#include?“intrins.h“
//#include?“Lcd1602.h“
#define?uchar?unsigned?char
#define?uint?unsigned?int

sbit?BEEP?=?P1^6;??//報(bào)警提示口
sbit?vout?=?P1^7;??//脈沖發(fā)送口
sbit?P3_2?=?P3^2;??//中斷接收口
sbit?P2_2?=?P2^2;

//sbit?INT?=?P1^6;?
bit?flag;
static?uchar?ledcode[12]?=?{0xC00xF90xA40xB00x990x920x820xF80x800x900xff0x7f};

//unsigned?char?discol[4]={0xef0xdf0xbf0x7f};
unsigned?char?code?Anum_code[]={“0123456789“};
unsigned?char?disbuf[4]={0123};
float?highlow;
unsigned?char?qianbaishige;
//unsigned?char?j=600;

/*void?delay_1ms(void)??//12mhz?delay?1.01ms
{
???unsigned?char?xy;???
???x=3;
???while(x--)?
??{
?????y=40;
?????while(y--);
??}
}

void?delay_1us(unsigned?char?i)?//i=1?5us;?i=27us;?i=39us
{?
????while(--i);?
}*/

void?delay_50us(unsigned?int?t)?//?t=100?5ms;?t=1000?50ms
{
?unsigned?char?j;??
?for(;t>0;t--)???
??for(j=19;j>0;j--);
}

/*void?delay_50ms(unsigned?int?t)?//?t=10?500ms;?t=100?5s;
{
?unsigned?int?j;?
?for(;t>0;t--)?
??for(j=6245;j>0;j--);
}*/
void?display(void)
{
?? uint?aij;
for(j=0;j<400;j++)
{
for(i=0;i<4;i++) ???????????????//?四路掃描
???? {
??
??P0?=?ledcode[disbuf[3-i]]; //?發(fā)送顯示數(shù)據(jù)
??P2?=?~(1< ??for?(a=0;?a<40;?a++); ????//?延時(shí)一段時(shí)間
??P2?|=?(1< ???? }
??P2_2?=?0;
??P0?=?ledcode[11]; ????????????//?顯示小數(shù)點(diǎn)
??? ??
???? ??for?(a=0;?a<40;?a++);
??????P2_2?=?1;
}
}

void?work(void)
{?
??//unsigned?char?qianbaishige;
??float?value;
??value=(high*256+low)*17/100;
??qian=value/1000;
??bai=(value-qian*1000)/100;
??shi=(value-qian*1000-bai*100)/10;
??ge=value-qian*1000-bai*100-shi*10;
??if(value<=1000)
??{
????BEEP=0;
??}
??else
??{
????BEEP=1;
??}
??disbuf[0]?=

評(píng)論

共有 條評(píng)論

相關(guān)資源