欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標(biāo)題: 52智能小車+紅外遙控+超聲波,紅外避障+PWM波調(diào)速度+超聲波測距+測小車行駛速度,距離。 [打印本頁]

作者: 770880    時間: 2019-11-11 16:12
標(biāo)題: 52智能小車+紅外遙控+超聲波,紅外避障+PWM波調(diào)速度+超聲波測距+測小車行駛速度,距離。
52智能小車+紅外遙控+超聲波,紅外避障+PWM波調(diào)速度+超聲波測距+測小車行駛速度,距離+紅外循跡

單片機源程序如下:
  1. /***************************************

  2.                                                 《智能小車》

  3.                                 作者:   歡。
  4.                                 功能:        紅外遙控         
  5.                                                         超聲波,紅外避障
  6.                                                         PWM波調(diào)速度
  7.                                                         超聲波測距
  8.                                                         測小車行駛速度,行走路程
  9.                                                         紅外循跡
  10.                                                        
  11. *****************************************/

  12. #include "reg52.h"
  13. #include "CarControl.h"
  14. #include "lcd1602.h"
  15. #include "SuperWave.h"
  16. #include "IRLED.h"
  17. #include "MeasureSpeed.h"


  18. #define uchar unsigned char
  19. #define uint unsigned int

  20. sfr IPH            = 0XB7;//優(yōu)先級配置寄存器
  21. sbit IRIN = P3^3;         //紅外接收器數(shù)據(jù)線
  22. extern uchar IRLedValue ;//紅外遙控器值
  23. extern bit RedTracking;//是否循跡
  24. bit IsCarRunning=0;//車是否在跑

  25. /***************************************
  26.        
  27.         定時器0:計數(shù)器模式,用于計算碼盤脈沖個數(shù)
  28.         定時器1:定時器模式,用于計算超聲波距離
  29.         定時器2:定時器模式,產(chǎn)生PWM波
  30.         外部中斷0:紅外接收中斷
  31.         優(yōu)先級:
  32.         外部中斷0 >  定時器2 >  定時器1  >  定時器0
  33. *****************************************/

  34. void main()
  35. {
  36.         PT0=1;        //提升外部中斷1高于定時器0
  37.         IPH|=0x22;//提升定時器2優(yōu)先級僅次于外部中斷1
  38.         PWMinit();
  39.         LCD_Init();
  40.         SuperWave_Init();
  41.         IRLED_Init();
  42.         MeasureSpeed_Init_T0();
  43.         LCD_Write_String(0,0,"Num:  ");
  44.         while(1)
  45.         {
  46.                 if(RedTracking == 0)
  47.                 {
  48.                         SuperWave_GetCount();
  49.                 }
  50.                 else
  51.                 {
  52.                         Tracking();
  53.                 }
  54.         }
  55. }
復(fù)制代碼

所有資料51hei提供下載:
智能遙控小車.rar (70.91 KB, 下載次數(shù): 99)



作者: admin    時間: 2019-11-11 18:21
本帖需要重新編輯補全電路原理圖,源碼,詳細(xì)說明與圖片即可獲得100+黑幣(帖子下方有編輯按鈕)
作者: Dare1    時間: 2019-11-16 23:31
小劉師兄你好!




歡迎光臨 (http://m.raoushi.com/bbs/) Powered by Discuz! X3.1