单片机演奏音乐

时间:2017-01-04 05:22:19
【文件属性】:

文件名称:单片机演奏音乐

文件大小:97KB

文件格式:RAR

更新时间:2017-01-04 05:22:19

单片机

/************************************************* *文件名称: PlayMusic.c *作 者: *版 本: V1.00 *环 境: Keil uVision4 *说 明: 单片机演奏音乐实验 *修改记录: 2012.5 -------------------------------------------------- *Descriptoon: 演奏世上只有妈妈好 *接线说明: P30——蜂鸣器 **************************************************/ #include #define uchar unsigned char #define uint unsigned int sbit speaker=P3^0; uchar timer0h,timer0l,time; //世上只有妈妈好数据表 uchar code jiepai[]={ 3,1,2,2, 2,1,1,4, 2,1,1,2,2, 1,1,1,1,4, 3,1,2,1,1, 2,2,4, 3,1,1,1,1,1, 6 }; uchar code FREQH[]={0xFD,0xFD,0xFD,0xFD, 0xFE,0xFD,0xFD,0xFD, 0xFD,0xFD,0xFD,0xFD,0xFD, 0xFC,0xFB,0xFD,0xFD,0xFC, 0xFC,0xFD,0xFD,0xFD,0xFD, 0xFD,0xFC,0xFC, 0xFD,0xFD,0xFC,0xFC,0xFB,0xFC, 0xFB }; uchar code FREQL[]={0xF4,0xB4,0x44,0xB4, 0x47,0xF4,0xB4,0xF4, 0x44,0xB4,0xF4,0xB4,0x44, 0x8F,0xE9,0xB4,0x44,0xEE, 0xEE,0x44,0xB4,0xB4,0xF4, 0x44,0xEE,0x8F, 0xB4,0x44,0xEE,0x8F,0xE9,0x8F, 0x68 }; void delay(uchar t) //延时大约250ms { uchar t1; unsigned long int t0; for(t1=0;t1=34) m=0; } } }


【文件预览】:
EXP30_单片机演奏音乐实验
----《世上只有妈妈好》()
--------PlayMusic.DSN(76KB)
--------PlayMusic.uv2(2KB)
--------Last Loaded PlayMusic.DBK(76KB)
--------PlayMusic.c(3KB)
--------PlayMusic.PWI(766B)
--------PlayMusic.hex(984B)
----《祝你生日快乐》()
--------PlayMusic.lnp(39B)
--------PlayMusic.LST(4KB)
--------PlayMusic.uvproj(13KB)
--------PlayMusic.uv2.bak(2KB)
--------PlayMusic.DSN(75KB)
--------PlayMusic.M51(6KB)
--------PlayMusic.omf(5KB)
--------PlayMusic_uvopt.bak(71KB)
--------Last Loaded PlayMusic.DBK(75KB)
--------PlayMusic.c(2KB)
--------PlayMusic.uvopt(71KB)
--------PlayMusic.OBJ(6KB)
--------PlayMusic.PWI(792B)
--------PlayMusic.hex(785B)
--------PlayMusic.omf.plg(2KB)
----1《祝你生日快乐》()
--------dff.plg(232B)
--------STARTUP.OBJ(767B)
--------dff.hex(785B)
--------Text1.c(2KB)
--------Text1.LST(4KB)
--------dff.lnp(41B)
--------STARTUP.A51(6KB)
--------dff.Uv2(2KB)
--------dff.Opt(1KB)
--------Text1.OBJ(5KB)
--------STARTUP.LST(11KB)
--------dff(5KB)
--------dff_Uv2.Bak(0B)
--------dff.M51(7KB)

网友评论