標(biāo)題: 從左到右的流水燈流水燈的仿真 [打印本頁(yè)]

作者: 楓未名    時(shí)間: 2017-5-10 18:20
標(biāo)題: 從左到右的流水燈流水燈的仿真
是不是很好玩
  1. #include <reg52.h>
  2. #include <intrins.h>
  3. #define uchar unsigned char
  4. #define uint unsigned int

  5. void DelayMS(uint x)
  6. {
  7.         uchar i;
  8.         while(x--)
  9.         {
  10.                  for(i=120;i>0;i--);
  11.         }
  12. }

  13. void main()
  14. {
  15.         P0 = 0xFE;
  16.         while(1)
  17.         {
  18.                  P0 = _crol_(P0,1);
  19.                 DelayMS(150);
  20.         }
  21. }
復(fù)制代碼

下載:
02 從左到右的流水燈.zip (45.4 KB, 下載次數(shù): 12)






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