【资源下载】下载地址如下:
https://docs.qq.com/doc/DTlRSd01BZXNpRUxl
音乐盒电子琴功能描述:
- 实现音乐盒功能可以播放音乐,并实现3首歌曲的切换
- 实现电子琴的功能,多瑞米法索拉稀7个调的音
#include <AT89X52.H> #define uint unsigned int #define uchar unsigned char unsigned int code tab[]= {63628,63835,64021,64103, 64260,64400,64524,64580, 64684,64777,64820,64898, 64968,65030,65058,65110};//频率表 uchar code table[]={ 0x3f,0x06,0x5b,0x4f, 0x66,0x6d,0x7d,0x07, 0x7f,0x6f,0x77,0x7c, 0x39,0x5e,0x79,0x71,0};//数码管段码显示值 unsigned char Count; sbit bee_Speak =P1^2 ; //蜂鸣器器控制脚 unsigned char code zhuni[]={ //祝你平安 0x26,0x20,0x20,0x20,0x20,0x20,0x26,0x10,0x20,0x10,0x20,0x80,0x26,0x20,0x30,0x20, 0x30,0x20,0x39,0x10,0x30,0x10,0x30,0x80,0x26,0x20,0x20,0x20,0x20,0x20,0x1c,0x20, 0x20,0x80,0x2b,0x20,0x26,0x20,0x20,0x20,0x2b,0x10,0x26,0x10,0x2b,0x80,0x26,0x20, 0x30,0x20,0x30,0x20,0x39,0x10,0x26,0x10,0x26,0x60,0x40,0x10,0x39,0x10,0x26,0x20,