1024手机基地看电影,午夜福利视频导航,国产精品福利在线一区,亚洲欧美日韩另类成人,在线观看午夜日本理论片,成年超爽免费网站,国产精品成人免费,精品动作一级毛片,成人免费观看网站,97精品伊人久久大香蕉

標題: 單片機流水燈控制器設計仿真 [打印本頁]

作者: 123周海    時間: 2017-5-23 21:28
標題: 單片機流水燈控制器設計仿真
單片機流水燈控制器設計仿真


單片機代碼:
  1. #include <REGX52.H>

  2. void Delay1ms(unsigned int count)
  3. {
  4.         unsigned int i,j;
  5.         for(i=0;i<count;i++)
  6.         for(j=0;j<120;j++);
  7. }

  8. main()
  9. {
  10.         unsigned char LEDIndex = 0;
  11.         bit LEDDirection = 1;

  12.         while(1)
  13.         {
  14.                 if(LEDDirection)
  15.                         P1 = ~(0x01<<LEDIndex);
  16.                 else
  17.                         P1 = ~(0x80>>LEDIndex);       
  18.                 if(LEDIndex==7)
  19.                         LEDDirection = !LEDDirection;
  20.                 LEDIndex = (LEDIndex+1)%8;
  21.                 Delay1ms(100);
  22.         }
  23. }
復制代碼

下載:
4e46dc67290d10bad76915cacf2700e4.rar (61.07 KB, 下載次數(shù): 9)








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