求问程序,如何用两位数码管显示从00开始,到03,06,09,12.答:你要程序,也不给仿真图或原理图,只好画一个仿真图,采用两位静态显示数码管,按下面这个仿真图写的程序如下 include<reg51.h> unsigned char code tab[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};void delay(unsigned char x)//延时子程序 { unsigned int j;while(x--)...
...的P3.7管脚接一个按键,作为手动计数器的按钮,用一位数码管显示...答:这是仿真原理图,用一位共阴数码管,P1口输出段码,不用动态扫描。程序如下:include <reg51.h>sbit ins1=P3^7;unsigned char code segment[]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x27,0x7F,0x6F};//段码表void main(){unsigned char x=0;while (1){P1=segment[x];if(ins1==0...