发布网友 发布时间:2022-05-17 05:03
共2个回答
热心网友 时间:2023-10-08 22:43
#include char tt = 0;bit flg;char code table[] = { //共阳段码 0 ~ 9 0xC0, 0xf9, 0xa4, 0xb0, 0x99, 0x92, 0x82, 0xf8, 0x80, 0x90};void main(){ TMOD = 0x01; TH0 = 0x3C; TL0 = 0xB0; IE = 0x82; TR0 = 1; while (1);}void b() interrupt 1{ TH0 = 0x3C; TL0 = 0xB0; tt++; if (tt == 10) { tt = 0; flg = !flg; if(flg) { SBUF = table[3]; while(!TI); TI = 0; SBUF = table[2]; while(!TI); TI = 0; SBUF = table[1]; while(!TI); TI = 0; SBUF = table[0]; while(!TI); TI = 0; } else { SBUF = table[7]; while(!TI); TI = 0; SBUF = table[6]; while(!TI); TI = 0; SBUF = table[5]; while(!TI); TI = 0; SBUF = table[4]; while(!TI); TI = 0; } }}热心网友 时间:2023-10-08 22:44
4位静态?