?? music.c
字號(hào):
#include<reg51.h>
#include<define.h>
#include<global.h>
#include<initial.h>
#include<delay.h>
#include<led.h>
#include<input.h>
#include<beep.h>
#include<key.h>
#include<music.h>
byte code SOUNDLONG[ ] =
{
12,12,12,12,12,12,12,
12,12,12,12,12,12,12,12
};
byte code SOUNDTONE[] =
{
3,188,3,83,2,246,2,204,2,125,2,56,1,250,
1,221,1,169,1,123,1,101,1,28,0,253,0,258
};
void Music(byte count)
{
byte i,k,j,SoundLong;
word m,SoundTone;
for(k=0;k<count;k++)
{
for(i=0;i<15;i++)
{
SoundLong = SOUNDLONG[i];
SoundTone = SOUNDTONE[i*2]<<2;
SoundTone+=SOUNDTONE[i*2+1];
for(j=0;j<SoundLong;j++)
{
for(m=0;m<SoundTone;m++)
P1_6=0;
for(m=0;m<SoundTone;m++)
P1_6=1;
}
DelayX10ms(50);
}
DelayX10ms(300);
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -