按键控制定时器选多段音乐

 

#include <reg52.h>
#include <intrins.h>
#define uchar unsigned char
#define uint unsigned int

uchar Song_Index = 0,Tone_Index = 0;
sbit SPK = P3^7;
sbit K1 = P1^0;
uchar code DSY_CODE[]=
{
 	0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90
};

uchar code HI_LIST[]=
{
 	0,266,229,232,233,236,238,240,241,242,244,245,246,247,248
};
uchar code LO_LIST[]=
{
 	0,4,13,10,20,3,8,6,2,23,5,26,1,4,3
};

uchar code Song[][50]=
{
 	{1,2,3,1,1,2,3,1,3,4,5,3,4,5,3,4,5,5,6,1,2,3,6,2,6,6,2,3,4,5,2,5,2,3,-1},
	{3,3,3,5,6,2,3,4,6,2,6,4,2,1,2,3,6,2,5,6,3,4,5,6,2,3,1,2,3,5,1,2,3,-1},
	{3,2,1,3,2,1,1,2,3,1,3,5,1,5,4,6,2,6,3,4,2,3,6,2,3,4,2,1,1,1,2,2,2,3,3,2,6,3,5,3,5,1,2,6,4,5,-1}
};

uchar code Le
  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值