unsigned char tone;
unsigned char op;
sbit led=P1^1;
sbit spk=P1^0;
sbit key1=P3^2;
sbit key2=P3^3;
unsigned char code shuma[]={
0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90};
//用于使定时器初值变化以产生相应频率的定时
unsigned char code yinfu_H[]=
{0xfb,0xfc,0xfc,0xfc,0xfd,0xfd,0xfd,0xfd,0x00};
unsigned char code yinfu_L[]=
{0xe9,0x5c,0xc1,0xef,0x45,0x92,0xd0,0xee,0x00};
void delay(unsigned int N)
{
}
unsigned
{1,2,3,1,1,2,3,1,3,4,5,3,4,5,5,6,5,4,3,1,5,6,5,4,3,1,3,1,1,3
,1,1};//两只老虎乐谱
unsigned
{220,220,220,220,220,220,220,220,220,220,235,220,220,210,150
,150,
170,170,200,200,150,150,170,170,200,200,244,240,250,244,220,
250};
//定时器初始化
void initTimer(void)
{
}
//定时器T0中断服务程序
void timer0(void) interrupt 1
{
}
void laohu_yz()//两只老虎 演奏程序
{
}
void yuep_yz()//1~i音符演奏程序
{
}
void jianpan()
{
}
//主程序
void main(void)
{
while(1)
else if(key2==0)//判断K2键是否按下
}
上一篇:精巧的4*4键盘程序
下一篇:ADC0809做的51单片机8路电压采集
推荐阅读最新更新时间:2024-03-16 14:44