单片机计数器C程序答:sbit wela=P2^7;uchar code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};void delay(uchar i){ for(j=i;j>0;j--)for(k=125;k>0;k--);} void display(uchar sh_c,uchar g_c){ dula=0;P0=table[sh_c];dula=1...
求一个单片机计数器程序,答:include<reg51.h>#define uchar unsigned charuchar table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f};sbit key=P3^7;main(){uchar i,key;while(1){if(key==0) { while(key==0); i++; i%=10; P0=table(i); }}} ...
设计一个24小时制时钟计数器。用汇编语言答:下面的程序,经过仿真测试,满足要求。晶振为12MHz.ORG 0000H MOV TMOD, #01H MOV TH0, #3CH MOV TL0, #0B0H MOV R7, #20 SETB TR0 MOV R4, #0 MOV R5, #0 MOV R6, #0 _DISP:MOV P2, R4 MOV P1, R5 MOV P0, R6 START:JNB P3.0, T0_TF0 CLR ...