51单片机按键控制数码管显示两格数字

[复制链接]
 楼主| 小菜鸡嘤嘤嘤 发表于 2022-9-11 14:54 | 显示全部楼层 |阅读模式
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();
        }
}
cszmlyd 发表于 2022-9-17 15:21 | 显示全部楼层

51单片机按键控制数码管显示两格数字

全程无备注,看不懂。

归依龙井 发表于 2022-9-22 16:46 | 显示全部楼层
至少要说出是什么问题吧?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1

主题

1

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部

1

主题

1

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部