问答

汇集网友智慧,解决技术难题

小菜鸡嘤嘤嘤

TA的家园币:10  

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

    voidxuanjian(unsignedchari,unsignedcharS){unsignedcharb=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);}}}}}}voidjzjianpan1(){L1=0;L2=1;L3=1;L4=1;xuanjian(0,S1);xuanjian(1,S2);xuanjian(2,S3);xuanjian(3,S4);}voidmain(){while(1){jzjianpan1();}}