资源简介
可以把音乐简谱转换成十六进制的tool;
代码片段和文件信息
#include “reg52.h“
unsigned char Count;
sbit _Speak =P2^3 ; //讯响器控制脚
unsigned char code SONG[] ={ //祝你平安
0x260x200x200x200x200x200x260x100x200x100x200x800x260x200x300x20
0x300x200x390x100x300x100x300x800x260x200x200x200x200x200x1c0x20
0x200x800x2b0x200x260x200x200x200x2b0x100x260x100x2b0x800x260x20
0x300x200x300x200x390x100x260x100x260x600x400x100x390x100x260x20
0x300x200x300x200x390x100x260x100x260x800x260x200x2b0x100x2b0x10
0x2b0x200x300x100x390x100x260x100x2b0x100x2b0x200x2b0x400x400x20
0x200x100x200x100x2b0x100x260x300x300x800x180x200x180x200x260x20
0x200x200x200x400x260x200x2b0x200x300x200x300x200x1c0x200x200x20
0x200x800x1c0x200x1c0x200x1c0x200x300x200x300x600x390x100x300x10
0x200x200x2b0x100x260x100x2b0x100x260x100x260x100x2b0x100x2b0x80
0x180x200x180x200x260x200x200x200x200x600x260x100x2b0x200x300x20
0x300x200x1c0x200x200x200x200x800x260x200x300x100x300x100x300x20
0x390x200x260x100x2b0x100x2b0x200x2b0x400x400x100x400x100x200x10
0x200x100x2b0x100x260x300x300x800x00
//路边的野华不要采
0x300x1C0x100x200x400x1C0x100x180x100x200x100x1C0x100x180x400x1C
0x200x200x200x1C0x200x180x200x200x800xFF0x200x300x1C0x100x180x20
0x150x200x1C0x200x200x200x260x400x200x200x2B0x200x260x200x200x20
0x300x800xFF0x200x200x1C0x100x180x100x200x200x260x200x2B0x200x30
0x200x2B0x400x200x200x1C0x100x180x100x200x200x260x200x2B0x200x30
0x200x2B0x400x200x300x1C0x100x180x200x150x200x1C0x200x200x200x26
0x400x200x200x2B0x200x260x200x200x200x300x800x200x300x1C0x100x20
0x100x1C0x100x200x200x260x200x2B0x200x300x200x2B0x400x200x150x1F
0x050x200x100x1C0x100x200x200x260x200x2B0x200x300x200x2B0x400x20
0x300x1C0x100x180x200x150x200x1C0x200x200x200x260x400x200x200x2B
0x200x260x200x200x200x300x300x200x300x1C0x100x180x400x1C0x200x20
0x200x260x400x130x600x180x200x150x400x130x400x180x800x00
};
void Time0_Init()
{
TMOD = 0x01;
IE = 0x82;
TH0 = 0xD8;
TL0 = 0xEF; //12MZ晶振,10ms
}
void Time0_Int() interrupt 1
{
TH0 = 0xD8;
TL0 = 0xEF;
Count++; //长度加1
}
/*-------------------------------------------------
功能:1MS延时子程序
-------------------------------------------------*/
void Delay_xMs(unsigned int x)
{
unsigned int ij;
for( i =0;i < x;i++ )
{
for( j =0;j<3;j++ );
}
}
/*-------------------------------------------------
功能:歌曲播放子程序i为播放哪一段曲目
-------------------------------------------------*/
void Play_Song(unsigned char i)
{
unsigned char Temp1Temp2;
unsigned int Addr;
Count = 0; //中断计数器清0
Addr = i * 217;
while(1)
{
Temp1 = SONG[Addr++];
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3707 2010-05-25 22:18 main.c
文件 224768 2010-05-26 11:09 单片机音乐转换.exe
----------- --------- ---------- ----- ----
228475 2
- 上一篇:心音听诊wav格式记录的波形数据
- 下一篇:SPOOLING假脱机技术模拟
相关资源
- 单片机试题库以及答案分析
- 基于51单片机的烟雾报警器
- 基于51单片机实现的电子琴
- 单片机红外报警系统仿真与源码和上
- 基于51单片机的m序列产生及应用研究
- 酒后驾车的传感器的设计
- 基于51单片机的全自动洗衣机设计带
- 音乐播放器,含有音乐列表显示当前
- QT4音乐播放器源码
- 基于51单片机的智能充电器
- 超声波测距及报警程序
- MSP430单片机DS18B20测温、LCD1602显示、报
- hx711压力传感器51单片机代码
- 基于单片机的篮球计数器
- [嵌入式Linux项目实战开发]基于QT4.7.
- 51单片机蜂鸣器播放歌曲实验报告
- 网易云音乐刷听歌量
- 单片机 压力测量 模数转换
- 基于单片机的交通灯控制系统设计
- 用51编写青花瓷
- 基于单片机的PM2.5检测
- VHDL语言FPGA音乐程序
- 基于STM32F103RCT6的无源蜂鸣器音乐播放
- 基于51单片机的全自动洗衣机控制系统
- 基于MSP430单片机温湿度控制器
- 模拟音乐播放器——利用DVCC实验箱,
- 基于单片机DS1302+DS18B20+DHT11+LCD12864的万
- 基于单片机家用防盗报警系统设计
- 单片机温度检测系统
- 基于单片机的密码锁(包括开锁、报
评论
共有 条评论