21ic问答首页 - 51单片机按键控制数码管显示两格数字
51单片机按键控制数码管显示两格数字
小菜鸡嘤嘤嘤2022-09-11
void xuanjian(unsigned char i,unsigned char S)
{
unsigned char b=0;
if(S == 0)
{
Delay10us();
if(S == 0)
{
b = 1;
while(b == 1)
{
xuanwei(i/10,1);
Delay1ms();
xuanwei(i%10,2);
Delay1ms();
HC138(6);
P0 = 0x03;
HC138(7);
P0 = 0xff;
while(S == 0);
Delay10ms();
if(S == 0)
{
Delay10us();
if(S == 0)
{
b = 0;
while(S == 0);
}
}
}
}
}
}
void jzjianpan1()
{
L1 = 0;
L2 = 1;L3 = 1;L4 = 1;
xuanjian(0,S1);
xuanjian(1,S2);
xuanjian(2,S3);
xuanjian(3,S4);
}
void main()
{
while(1)
{
jzjianpan1();
}
}
{
unsigned char b=0;
if(S == 0)
{
Delay10us();
if(S == 0)
{
b = 1;
while(b == 1)
{
xuanwei(i/10,1);
Delay1ms();
xuanwei(i%10,2);
Delay1ms();
HC138(6);
P0 = 0x03;
HC138(7);
P0 = 0xff;
while(S == 0);
Delay10ms();
if(S == 0)
{
Delay10us();
if(S == 0)
{
b = 0;
while(S == 0);
}
}
}
}
}
}
void jzjianpan1()
{
L1 = 0;
L2 = 1;L3 = 1;L4 = 1;
xuanjian(0,S1);
xuanjian(1,S2);
xuanjian(2,S3);
xuanjian(3,S4);
}
void main()
{
while(1)
{
jzjianpan1();
}
}
赞0
评论
2022-09-22
赞0
评论
2022-09-17
您需要登录后才可以回复 登录 | 注册