求: 用51单片机c语言操作使蜂鸣器奏出“祝你生日快乐”音乐的全部程序...答:include <reg51.h> sbit speaker=P1^2;unsigned char timer0h,timer0l,time;//生日歌 code unsigned char sszymmh[]={5,1,1, 5,1,1, 6,1,2, 5,1,2, 1,2,2, 7,1,4,5,1,1, 5,1,1, 6,1,2, 5,1,2, 2,2,2, 1,2,4,5,1,1, 5,1,1, 5,2,2, 3,2,2,...
求51单片机蜂鸣器播放音乐的教程 C语言答:uchar keyscan(void);//键盘扫描程序 void delay(uint i); //延时子程序/*--- T0的值,及输出频率对照表 ---*/ uchar code freq[36*2]={ 0xA9,0xEF, //0x3F,0XEE,//00220HZ ,1 //0 0x93,0xF0, //0X3D,0XEF,//00233HZ ,1 0x73,0xF1, //0X30,0XF0,//00247HZ...
单片机加矩阵按键控制蜂鸣器唱歌,按一下一个键是前一首,另一个是后一...答:include <reg52.h> include <intrins.h> define uchar unsigned char define uint unsigned int uchar Song_Index = 0,Tone_Index = 0;sbit SPK = P3^7;sbit K1 = P1^0;uchar code DSY_CODE[]= { 0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90 };uchar code HI_LIST[]=...