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

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 2470|回復: 0
收起左側

機械臂小車尋白線stm32程序

[復制鏈接]
ID:245445 發表于 2017-11-2 19:55 | 顯示全部樓層 |閱讀模式

單片機源程序如下:
  1. #include "stm32f10x.h"
  2. #include "drive.h"
  3. #include "hongwai.h"
  4. #include "chaoshengbo.h"
  5. #include "timer.h"
  6. #include "delay.h"
  7. #include "stm32f10x_gpio.h"
  8. #include "usart.h"
  9. #include "stm32f10x_it.h"
  10. #include "duoji.h"
  11. #include "shengjiangtai.h"
  12. #include "led.h"
  13. #include "beep.h"
  14. #include "xianwei.h"
  15. int jsnum = 0;
  16. extern int hwflag;
  17. int main()
  18. {
  19.        
  20.           SystemInit();
  21.           driveGPIO_Init();
  22.                 delay_init();                                        //延時初始化
  23.           UltrasonicWave_Configuration();               //對超聲波模塊初始化
  24.           uart_init(9600);                              //串口初始化
  25.           NVIC_Configuration();                         //設置優先級
  26.           Timerx_Init(5000,7199);                       //10Khz的計數頻率,計數到5000為500ms
  27.     TIM3_PWM_Init(899,0);                                //不分頻。PWM頻率=72000000/900=80Khz
  28.           TIM3_PWM_Init2(899,0);                              //不分頻。PWM頻率=72000000/900=80Khz
  29.           LED_Init();                                                            //初始化與LED連接的硬件接口
  30.           BEEP_Init();                                         //初始化蜂鳴器端口
  31.     shengjiangtaiGPIO_Init();                     //初始化升降臺
  32.     duoji(0x23,0x31,0x32,0x47,0x43,0x31,0x0D,0x0A);
  33.           while(1)
  34.                {
  35.                                         if (jsnum > 500 || hwflag == 1)
  36.                                         {
  37.                                                         UltrasonicWave_StartMeasure();
  38.                                                         jsnum = 0;

  39.                                         }                                                //開始測距,發送一個>10us的脈沖,然后測量返回的高電平時間
  40.                       delay_ms(1);
  41.                                         jsnum++;
  42.                                         LED0=0;
  43.                                         xunji();                               
  44.                      }
  45. }

復制代碼

所有資料51hei提供下載:
機械臂小車尋白線程序.rar (296.38 KB, 下載次數: 21)


回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表