📄 main.c
字号:
#include <reg51.h>
typedef unsigned char BYTE;
sbit P30=P3^0;
sbit P31=P3^1;
sbit P32=P3^2;
sbit P33=P3^3;
sbit P34=P3^4;
sbit P35=P3^5;
sbit P36=P3^6;
sbit P37=P3^7;
main()
{
BYTE temp;
START: ACC=P3;
P1=ACC;
ACC=~ACC;
ACC&=0x0F;
temp=ACC;
S1: while(1)
{
if(!P36)
{
while(1)
{
if(temp==0x0F)
{
if(P36)
{
goto START;
}
}
else
{
temp++;
ACC=temp;
ACC=~ACC;
ACC&=0x0F;
while(1)
{
P1=ACC;
if(P36) goto S1;
}
}
}
}
if(!P37)
{
while(1)
{
if(temp==0x00)
{
if(P37) goto START;
}
else
{
temp--;
ACC=temp;
ACC=~ACC;
ACC&=0x0F;
while(1)
{
P1=ACC;
if(P37) goto S1;
}
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -