欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136
標(biāo)題:
超聲波避障部分程序源代碼
[打印本頁]
作者:
1329866424
時間:
2017-4-27 15:39
標(biāo)題:
超聲波避障部分程序源代碼
#include <REGX51.H>
#include <stdio.h>
#define uint unsigned int
uint i,j,k;
void delay(i);
void main()
{
P0=0xFF;
while(1)
{
if(P1_0==0)
{
P2=0x11;
delay(1500);
P2=0x22;
delay(1500);
P2=0x44;
delay(1500);
P2=0x88;
delay(1500);
}
if(P1_0!=0)
{
j=0;
for (j=0;j<13;j++)
{
P2=0x18;
delay(1500);
P2=0x24;
delay(1500);
P2=0x42;
delay(1500);
P2=0x81;
delay(1500);
}
if(P1_0!=0)
{
j=0;
for (j=0;j<23;j++)
{
P2=0x81;
delay(1500);
P2=0x42;
delay(1500);
P2=0x24;
delay(1500);
P2=0x18;
delay(1500);
}
}
if(P1_0!=0)
{
j=0;
for (j=0;j<36;j++)
{
P2=0x18;
delay(1500);
P2=0x24;
delay(1500);
P2=0x42;
delay(1500);
P2=0x81;
delay(1500);
}
}
}
if(P1_0!=0)
{
j=0;
for (j=0;j<52;j++)
{
P2=0x81;
delay(1500);
P2=0x42;
delay(1500);
P2=0x24;
delay(1500);
P2=0x18;
delay(1500);
}
if(P1_0!=0)
{
j=0;
for (j=0;j<65;j++)
{
P2=0x18;
delay(1500);
P2=0x24;
delay(1500);
P2=0x42;
delay(1500);
P2=0x81;
delay(1500);
}
}
if(P1_0!=0)
{
j=0;
for (j=0;j<80;j++)
{
P2=0x81;
delay(1500);
P2=0x42;
delay(1500);
P2=0x24;
delay(1500);
P2=0x18;
delay(1500);
}
}
}
}
}
/* us級延時函數(shù),參數(shù)i為延時時間 */
void delay(i) //延時子程序
{
while(--i);
}
歡迎光臨 (http://www.raoushi.com/bbs/)
Powered by Discuz! X3.1