ImageVerifierCode 换一换
格式:DOC , 页数:5 ,大小:42.50KB ,
资源ID:2289429      下载积分:150 文钱
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,省得不是一点点
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.wenke99.com/d-2289429.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: QQ登录   微博登录 

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(51单片机蜂鸣器播放音乐代码(生日快乐-两只蝴蝶-祝你平安).doc)为本站会员(11****ws)主动上传,文客久久仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知文客久久(发送邮件至hr@wenke99.com或直接QQ联系客服),我们立即给予删除!

51单片机蜂鸣器播放音乐代码(生日快乐-两只蝴蝶-祝你平安).doc

1、 /*生日快 乐歌曲*/#include #define uint unsigned int #define uchar unsigned charsbit beep = P15;uchar code SONG_TONE=212,212,190,212,159,169,212,212,190,212,142,159,212,212,106,126,159,169,190,119,119,126,159,142,159,0;uchar code SONG_LONG=9,3,12,12,12,24,9,3,12,12,12,24,9,3,12,12,12,12,12,9,3,12,12,12,24

2、,0;/延时void DelayMS(uint x)uchar t;while(x-) for(t=0;t / 这是 单片机音乐代码生成器 生成的代码#define uchar unsigned charsbit beepIO=P15; / 输出 为 P1.5 可以修改 成 其它 IO 口uchar m,n; uchar code T492=0,0,0xF8,0x8B,0xF8,0xF2,0xF9,0x5B,0xF9,0xB7,0xFA,0x14,0xFA,0x66,0xFA,0xB9,0xFB,0x03,0xFB,0x4A,0xFB,0x8F,0xFB,0xCF,0xFC,0x0B,0xFC

3、,0x43,0xFC,0x78,0xFC,0xAB,0xFC,0xDB,0xFD,0x08,0xFD,0x33,0xFD,0x5B,0xFD,0x81,0xFD,0xA5,0xFD,0xC7,0xFD,0xE7,0xFE,0x05,0xFE,0x21,0xFE,0x3C,0xFE,0x55,0xFE,0x6D,0xFE,0x84,0xFE,0x99,0xFE,0xAD,0xFE,0xC0,0xFE,0x02,0xFE,0xE3,0xFE,0xF3,0xFF,0x02,0xFF,0x10,0xFF,0x1D,0xFF,0x2A,0xFF,0x36,0xFF,0x42,0xFF,0x4C,0xFF

4、,0x56,0xFF,0x60,0xFF,0x69,0xFF,0x71,0xFF,0x79,0xFF,0x81;uchar code music2=0,4,23,4,21,4,23,16,23,4,21,4,23,4,21,4,19,16,16,4,19,4,21,8,21,4,23,4,21,4,19,4,16,4,19,4,14,24,23,4,21,4,23,16,23,4,21,4,23,4,21,4,19,24,16,4,19,4,21,8,21,4,23,4,21,4,19,4,16,4,19,4,21,24,23,4,21,4,23,16,23,4,21,4,23,4,21,4,

5、19,16,16,4,19,4,21,8,21,4,23,4,21,4,19,4,16,4,19,4,14,24,23,4,26,4,26,16,26,4,28,4,26,4,23,24,21,4,23,4,21,8,21,4,23,4,21,4,19,4,16,4,16,2,19,2,19,24,0,20,26,4,26,4,28,4,31,4,30,4,30,4,28,4,23,4,21,4,21,4,23,16,0,4,23,4,23,4,26,4,28,8,28,12,16,4,23,4,21,4,21,24,23,4,26,4,26,4,23,4,26,8,0,4,31,8,30,4

6、,28,4,30,4,23,8,0,4,28,4,28,4,30,4,28,4,26,4,23,4,21,8,23,4,21,4,23,4,26,16,0xFF,0xFF;void delay(uchar p)uchar i,j; for(;p0;p-)for(i=181;i0;i-)for(j=181;j0;j-);void pause()uchar i,j;for(i=150;i0;i-)for(j=150;j0;j-);void T0_int() interrupt 1beepIO=!beepIO;TH0=Tm0; TL0=Tm1;void main()uchar i=0; TMOD=0

7、x01; EA=1; ET0=1; while(1) m=musici0;n=musici1; if(m=0x00)TR0=0;delay(n);i+; else if(m=0xFF)TR0=0;delay(30);i=0; else if(m=musici+10) TR0=1;delay(n);TR0=0;pause();i+;elseTR0=1;delay(n);i+; 祝你平安:#include “reg52.h“unsigned char Count;sbit _Speak =P15 ; unsigned char code SONG = /祝你平安0x26,0x20,0x20,0x2

8、0,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,0x2

9、0,0x30,0x20,0x30,0x20,0x39,0x10,0x26,0x10,0x26,0x80,0x26,0x20,0x2b,0x10,0x2b,0x10,0x2b,0x20,0x30,0x10,0x39,0x10,0x26,0x10,0x2b,0x10,0x2b,0x20,0x2b,0x40,0x40,0x20,0x20,0x10,0x20,0x10,0x2b,0x10,0x26,0x30,0x30,0x80,0x18,0x20,0x18,0x20,0x26,0x20,0x20,0x20,0x20,0x40,0x26,0x20,0x2b,0x20,0x30,0x20,0x30,0x2

10、0,0x1c,0x20,0x20,0x20,0x20,0x80,0x1c,0x20,0x1c,0x20,0x1c,0x20,0x30,0x20,0x30,0x60,0x39,0x10,0x30,0x10,0x20,0x20,0x2b,0x10,0x26,0x10,0x2b,0x10,0x26,0x10,0x26,0x10,0x2b,0x10,0x2b,0x80,0x18,0x20,0x18,0x20,0x26,0x20,0x20,0x20,0x20,0x60,0x26,0x10,0x2b,0x20,0x30,0x20,0x30,0x20,0x1c,0x20,0x20,0x20,0x20,0x8

11、0,0x26,0x20,0x30,0x10,0x30,0x10,0x30,0x20,0x39,0x20,0x26,0x10,0x2b,0x10,0x2b,0x20,0x2b,0x40,0x40,0x10,0x40,0x10,0x20,0x10,0x20,0x10,0x2b,0x10,0x26,0x30,0x30,0x80,0x00;void Time0_Init()TMOD = 0x01;IE = 0x82;TH0 = 0xD8;TL0 = 0xEF; /12MZ 晶振,10msvoid Time0_Int() interrupt 1TH0 = 0xD8;TL0 = 0xEF;Count+;

12、/长度加 1/*-功能:1MS 延时子程序-*/void Delay_xMs(unsigned int x)unsigned int i,j;for( i =0;i x;i+ )for( j =0;j3;j+ );void Play_Song(unsigned char i)unsigned char Temp1,Temp2;unsigned int Addr;Count = 0; /中断计数器清 0Addr = i * 217;while(1)Temp1 = SONGAddr+;if ( Temp1 = 0xFF ) /休止符TR0 = 0;Delay_xMs(100);else if ( Temp1 = 0x00 ) /歌曲结束符return;elseTemp2 = SONGAddr+;TR0 = 1;while(1)_Speak = _Speak;Delay_xMs(Temp1);if ( Temp2 = Count )Count = 0;break;/*-功能:主程序-*/void main()Time0_Init(); /定时器 0 中断初始化while(1)Play_Song(0); /播放

Copyright © 2018-2021 Wenke99.com All rights reserved

工信部备案号浙ICP备20026746号-2  

公安局备案号:浙公网安备33038302330469号

本站为C2C交文档易平台,即用户上传的文档直接卖给下载用户,本站只是网络服务中间平台,所有原创文档下载所得归上传人所有,若您发现上传作品侵犯了您的权利,请立刻联系网站客服并提供证据,平台将在3个工作日内予以改正。