當前位置:編程學習大全網 - 電腦編程 - 流水燈每次亮六盞的編程

流水燈每次亮六盞的編程

我這是總***6個燈點亮壹個作為流水的,妳照著葫蘆畫瓢就差不多了

//flow light and beep

#include <reg51.h>

#include <intrins.h>

unsigned char a,b,k,j;

sbit beep=P2^3;

void delay10ms()

{

for(a=100;a>0;a--)

for(b=225;b>0;b--);

}

void main()

{

k=0xfe;

while(1)

{

delay10ms();

beep=0;

delay10ms();

beep=1;

j=_crol_(k,1);

k=j;

P1=j;

}

}

  • 上一篇:無人作戰平臺的基本定義
  • 下一篇:核桃編程地址
  • copyright 2024編程學習大全網