单片机音频节奏灯_用C51写的单片机音乐彩灯程序

#define TLEDS 20//每个花样状态持续时间,以50mS为单位

#define NUM_OF_LED_S 4//每种模式LED花样数?

typedef unsigned char uchar;

typedef unsigned int uint;

data uchar led_array_num;//当前模式下,LED花样状态序号

data uchar music_array_num;//音符的序号

data uchar i;//模式号

data uchar t_count_led;//用于LED状态持续时间计时

data uint t_count_music;//

data uint t_yinfu;//音符持续时间

uchar code led_array_p0[4][NUM_OF_LED_S]={ {0xc0,0xc0,0xc0,0xc0},{0x38,0x38,0x38,0x38},{0x05,0x07,0x02,0x07},{0xff,0x81,0xff,0xff}};

uchar code led_array_p2[4][NUM_OF_LED_S]={ {0x07,0x0b,0x0d,0x0e},{0x07,0x09,0x0e,0x00},{0x06,0x09,0x06,0x00},{0x07,0x09,0x0e,0x00}};

uchar code music_array_h[4][128]={ {0xfc,0xfc,0xfc,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfe,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,

0xfc,0xfc,0xfc,0xfc,0xfc,0xfd,0xfd,0xfc,0xfc,0xfc,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfe,0xfd,0xfd,

0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfc,0xfc,0xfc,0xfc,0xfd,0xfc},

{0xfc,0xfc,0xfd,0xfc,0xfc,0xfc,0xfd,0xfc,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfc,0xfd,

0xfd,0xfd,0xfd,0xfd,0xfc,0xfc,0xfd,0xfc,0xfc,0xfd,0xfc},

{0xfb,0xfb,0xfb,0xfb,0xfc,0xfc,0xfb,0xfb,0xfb,0xfb,0xfc,0xfc,0xfb,0xfb,0xfd,0xfd,0xfc,0xfc,0xfb,0xfd,0xfd,

0xfd,0xfc,0xfc,0xfc},

{0xfc,0xfc,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfc,0xfc,0xfc,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfc,

0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfc,0xfc,0xfc,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfc,0xfc,0xfc}};

uchar code music_array_l[4][128]

  • 4
    点赞
  • 27
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值