專題內容是8051電子鍾
功能是到特定時間會唱出特定的一首歌(5個時段共5首)
可是目前只有電子鍾的部分有運作 聲音的部分一接上電源就發出奇怪的聲音
請大大們幫助找出問題(._.)....
音樂時間表(以按照順序):
早晨5:00: 風は吹いている(AKB48)
上午9:00: 前しか向かねえ(AKB48)
中午12:00: ごめんね、SUMMER(SKE48)
下午13:00: HAVE A NICE DAY(WORLD ORDER)
晚上18:00: 波音のオルゴール(HKT48)
凌晨00:00:為不干擾睡眠,不設任何音樂
程式碼:
#include <REGX52.H>
#define skey P3_0
#define mkey P3_1
#define pkey P3_2
#define buzzer P2_0
char i,song_ctr;
char tone_H,tone_L;
code char song1[]={12,12,12,12,12,14,12,12,12,12,12,12,14,16, 16,16,16,16,16,17,16, 16,14,14,12,12,14,12, 12,12,12,12,12,14,12, 12,12,12,12,12,14,16, 16,16,16,16,16,17,16, 19,17,16,14,12,14,14,12,12,};
code char song2[]={9,7,5,7,9, 5,7,12, 12,14,12,9,14,12 ,12,14,16,17,14,12, 9,5, 7,9,7, 9,7,5,7,9, 5,7,12, 12,14,12,9,14,12, 12,14,16,17,14,12,17,16,};
code char song3[]={7,7,7,14,11,12,12,11,12,14, 7,7,7,14,11,12,12,11,12,16,14,12,11, 12,11,9,16,14, 16,17,19,17,16, 12,11,12,9,11,12,19, 19,19,17,12,11,};
code char song4[]={10,10,10,10,10,10,5,5,9,7, 7,5,7,5,7,7,5,9,9,5, 7,5,7,5,7,7,5,9,9,7,5,};
code char song5[]={14,12,12,10,12,10,12,14,12,10,12,12,10,14, 10,14,12,14,12,14,15,14,12,10,10,9,12, 9,7,9,5, 5,7,9,10, 9,10,14,15,14,12,10,12,12,};
code int tone={392,415,440,464,494,523,554,587,622,659,698,740,784,831,880,932,988,1046,1109,1175,1245,1318,1397,1480,1568};
code char tab[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x27,0x7f,0x6f,
0x77,0x7c,0x39,0x5e,0x79,0x71};
code char com[]={0x7f,0xbf,0xdf,0xef};
bit k1flag,k2flag,flag;
char pcnt,mcnt,scnt,secnt=2,secout;
bit pflag,mflag,sflag, jack_say_hello_to_you ; ..
訪客只能看到部份內容,免費 加入會員 或由臉書 Google 可以看到全部內容