发布网友 发布时间:2022-05-12 18:05
共3个回答
热心网友 时间:2023-10-15 03:39
#include<reg51.h>
#define uchar unsigned char;
uchar distab[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71,0x00}; //0到f
uchar number;
void t0isr() interrupt 1
{
TH0=(65536-5000)/256;
TL0=(65536-5000)%256;
number++;
if(number>1)number=0;
switch(number)
{
case 0:P2=0x02;P0=distab[2];
break;
case 1:P2=0x01;P0=distab[9];
break;
default:break;
}
}
main()
{
TMOD=0x01;
TH0=(65536-5000)/256;
TL0=(65536-5000)%256;
TR0=1;
ET0=1;
EA=1;
while(1);
}
热心网友 时间:2023-10-15 03:39
先定义位选引脚热心网友 时间:2023-10-15 03:40
有点难