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

標(biāo)題: 簡單的步進(jìn)電機(jī)程序 [打印本頁]

作者: meghua520    時間: 2016-4-27 16:08
標(biāo)題: 簡單的步進(jìn)電機(jī)程序
希望有幫助于你們

  1. #include<reg52.h>
  2. #define uchar unsigned char
  3. #define uint unsigned int

  4. uchar step_table[] = {0x40,0x20,0x10,0x08};                //0100 0000 0010 0000 0001 0000 0000 1000

  5. void delay(uint a)
  6. {
  7.         while(a--);
  8. }

  9. void main()
  10. {
  11.         uchar i;
  12.         uint j = 512;
  13.         while(j--)
  14.         {
  15.         for(i=0;i<4;i++)
  16.           {
  17.                    P0 = step_table[i];
  18.                  delay(800);
  19.           }       
  20.           
  21.          }
  22.          while(1);
  23. }
復(fù)制代碼


_步進(jìn)電機(jī).rar

22.8 KB, 下載次數(shù): 21, 下載積分: 黑幣 -5






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