zuoyiyouyi.c
来自「这是用51单片机开发的流水灯程序」· C语言 代码 · 共 39 行
C
39 行
#include<reg52.h>
#include<intrins.h>//intrinsic内在的
#define uchar unsigned char
#define uint unsigned int
void delay(uint z);
uchar temp;//temp为八位的
uint num1=8;
uint num2=0;
void main()
{
while(1)
{temp=0xfe; //11111110
while(num1--)
{
P2=temp;
delay(500);
temp=_crol_(temp,1);
num2++;
}
while(num2--)
{
temp=_cror_(temp,1);
P2=temp;
delay(500);
}
num1=8;
}
}
void delay(uint z)
{
uint x,y;
for(x=z;x>0;x--)
for(y=110;y>0;y--);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?