专题内容是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 可以看到全部内容