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

標題: 單片機步進電機仿真89c51+uln2004a [打印本頁]

作者: 1263726410    時間: 2020-5-9 22:25
標題: 單片機步進電機仿真89c51+uln2004a
  1. #include<reg51.h>
  2. #include<absacc.h>
  3. #define uint unsigned int
  4. #define uchar unsigned char
  5. void delay(uint x);
  6. void out(char state)
  7. {
  8.         code uchar table[]={0x03,0x09,0x0c,0x06}; //反轉
  9. //        code uchar table[]={0x03,0x06,0x0C,0x09};//正轉
  10.         P1=table[state];
  11. //        PORT=table[state];
  12.         delay(8);
  13. }


  14. uchar phase=0;
  15. //out(uchar x);
  16. void main()
  17. {
  18.         for(;;)
  19.         {
  20.                 out(phase=++phase&0x03);//調用輸出函數
  21.         }
  22. }

  23. void delay(uint x)
  24. {
  25.         uchar j;
  26.         while(x-->0)
  27.         {
  28.                 for(j=0;j<125;j++)
  29.                 {;;}
  30.         }
  31. }
復制代碼


51hei截圖20200509222359.png (105.42 KB, 下載次數: 41)

51hei截圖20200509222359.png

步進電機仿真.zip

38.39 KB, 下載次數: 24, 下載積分: 黑幣 -5






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