資源簡介
基于HC-SR04超聲波測距模塊的避障小車
代碼片段和文件信息
#include
#include
#include
#include
void?main()
{
S1=100.0;
InitPWM();
InitUart(); ??
while(1)
{
distance1();
distance2();
distance3();
moveon(10080);
if(S1<0||S1>400)
S1=100;
if(S2<0||S2>400)
S2=100;
if(S3<0||S3>400)
S3=100;
while(S1<20)
{
if(S2>S3)
turnleft(100100);
else
turnright(10080);
distance1();
if(S1<0||S1>400)
S1=100;
}
while(S3<20)
{
turnleft(100100);
distance3();
if(S3<0||S3>400)
S3=100;
}
while(S2<20)
{
turnright(100100);
distance2();
if(S2<0||S2>400)
S2=100;
}
} ?
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????2089??2014-06-10?21:29??DIY避障小車\CEJU.h
?????文件??????12025??2014-06-12?23:22??DIY避障小車\DIY_BiZhang_Car
?????文件???????7179??2014-06-12?23:22??DIY避障小車\DIY_BiZhang_Car.hex
?????文件?????????37??2014-06-12?23:22??DIY避障小車\DIY_BiZhang_Car.lnp
?????文件??????15824??2014-06-12?23:22??DIY避障小車\DIY_BiZhang_Car.M51
?????文件????????173??2014-06-13?18:21??DIY避障小車\DIY_BiZhang_Car.plg
????.......????244093??2014-06-13?18:21??DIY避障小車\DIY_BiZhang_Car.uvgui.Administrator
????.......????241450??2014-06-12?23:22??DIY避障小車\DIY_BiZhang_Car.uvgui_Administrator.bak
????.......??????7264??2014-06-13?18:21??DIY避障小車\DIY_BiZhang_Car.uvopt
????.......?????13925??2014-05-26?23:44??DIY避障小車\DIY_BiZhang_Car.uvproj
????.......??????7266??2014-06-12?23:22??DIY避障小車\DIY_BiZhang_Car_uvopt.bak
????.......?????13771??2014-05-26?21:36??DIY避障小車\DIY_BiZhang_Car_uvproj.bak
?????文件????????685??2014-06-12?23:22??DIY避障小車\first.c
?????文件???????2959??2014-06-12?23:22??DIY避障小車\first.LST
?????文件??????13237??2014-06-12?23:22??DIY避障小車\first.OBJ
?????文件???????1557??2014-05-31?12:09??DIY避障小車\move.h
?????文件???????1001??2013-12-01?14:14??DIY避障小車\PWM.h
?????文件??????17735??2014-05-24?23:03??DIY避障小車\STC12C5A60S2.h
?????文件????????330??2014-05-26?20:45??DIY避障小車\USUALLY.h
?????目錄??????????0??2014-06-13?18:21??DIY避障小車
-----------?---------??----------?-----??----
???????????????602600????????????????????20
評論
共有 條評論