<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          我的ARM7程序

          作者: 時間:2016-11-26 來源:網(wǎng)絡(luò) 收藏
          這次的代碼可以說完全是被逼出來的,。大四的學長讓我?guī)退稣n程設(shè)計,而我接觸的時間并不算太長,但還是按要求完成了題目的要求,值得高興一下下,同時也知道了一個道理:人的潛力往往是逼出來的


          #include
          #include "stdio.h"
          #include "Motor.h"
          #include "LED.h"
          #include "KEY.h"
          #include "SysTickDelay.h"

          本文引用地址:http://www.ex-cimer.com/article/201611/321614.htm


          //int Freq=9000;//頻率8K;
          int number=10;
          int Sure_Stop=0;
          int Sure_Number=10;
          int Direction=0;


          int main(void)
          {
          SystemInit();//不能刪除,雖然RCC_Configuration函數(shù)中調(diào)用了,不知道為什么


          Motor_Init();
          KEY_Init();
          LED_Init();
          SysTick_Initaize();
          Speed(8000,5*Sure_Number);
          LED1_0;
          LED2_0;
          LED3_0;
          LED4_0;
          while (1)
          {
          switch(KEY_Scan())
          {
          case 1:
          LED1_1;
          if(Sure_Stop==0)
          {
          Sure_Stop=1;
          }
          else
          {
          Sure_Stop=0;
          number=10;
          Sure_Number=10;
          Direction=0;
          }
          break;
          case 2:
          LED2_1;
          if(number<20)
          {
          number++;
          }
          else
          {
          Sure_Stop=0;
          }
          break;
          case 3:
          LED3_1;
          if(number>0)
          {
          number--;
          }
          else
          {
          Sure_Stop=0;
          }
          break;
          case 4:
          LED4_1;
          if(Direction==1)
          {
          Direction=0;
          }
          else
          {
          Direction=1;
          }
          break;
          default:
          break;
          }

          if(Sure_Stop==0)
          {
          Motor_Stop();
          }
          if(Sure_Stop==1)
          {
          Sure_Number=number;
          Speed(8000,5*Sure_Number);
          if((Direction==0))
          {
          Motor_Forward();
          }
          else
          {
          Motor_Back();
          }
          }
          delay_ms(10);
          }

          }

          #ifdefUSE_FULL_ASSERT

          void assert_failed(uint8_t* file, uint32_t line)
          {


          while (1)
          {
          }
          }
          #endif



          關(guān)鍵詞: ARM7程

          評論


          技術(shù)專區(qū)

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();