-
51单片机按键控制数码管显示两格数字
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(); } }
1645浏览量 2回复量 关注量