#include"reg51.h"
#define uchar unsigned char
#define uint unsigned int
sbit sound=P3^2;
uchar code array[]={0x18,0x30,0x1c,0x10,0x20,0x40,0x1c,0x10,0x18,0x10,0x20,0x10,0x1c,0x10,
0x18,0x40,0x1c,0x20,0x20,0x20,0x1c,0x20,0x18,0x20,0x20,0x80,0xff,
0x20,0x30,0x1c,0x10,0x18,0x20,0x15,0x20,0x1c,0x20,0x20,0x20,0x26,0x40,
0x20,0x20,0x2b,0x20,0x26,0x20,0x20,0x20,0x30,0x80,0xff,
0x20,0x20,0x20,0x10,0x1c,0x10,0x20,0x20,0x26,0x20,0x2b,0x20,0x30,0x20,
0x2b,0x40,0x20,0x20,0x20,0x10,0x1c,0x10,0x20,0x20,0x26,0x20,0x2b,0x20,
0x30,0x20,0x2b,0x40,0x20,0x30,0x1c,0x10,0x18,0x20,0x15,0x20,0x15,0x20,0x1c,0x20,
0x20,0x20,0x26,0x40,0x20,0x20,0x2b,0x20,0x26,0x20,0x20,0x20,0x30,0x80,
0x20,0x20,0x20,0x10,0x1c,0x10,0x20,0x20,0x26,0x20,0x2b,0x20,0x30,0x20,
0x2b,0x40,0x20,0x20,0x20,0x10,0x1c,0x10,0x20,0x20,0x26,0x20,0x2b,0x20,
0x30,0x20,0x2b,0x40,0x20,0x30,0x1c,0x10,0x18,0x20,0x15,0x20,0x1c,0x20,
0x20,0x20,0x26,0x40,0x20,0x20,0x2b,0x20,0x26,0x20,0x20,0x20,0x30,0x80,
0x20,0x30,0x1c,0x10,0x18,0x40,0x1c,0x20,0x20,0x20,0x26,0x40,0x13,0x60,
0x18,0x20,0x15,0x40,0x13,0x40,0x18,0x80,0x00,0x00
};
uchar data count=0;
uint counter=0;
void init()
{
TMOD=0x01;
THO=0xff;
TL0=0xff;
EA=1;
ET0=1;
}
void timer0(void)interrupt 1 using 3
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余2页未读,立即下载