{"id":1493,"date":"2018-11-19T15:40:35","date_gmt":"2018-11-19T15:40:35","guid":{"rendered":""},"modified":"2018-11-19T23:40:58","modified_gmt":"2018-11-19T15:40:58","slug":"%e5%8d%95%e7%89%87%e6%9c%ba%e8%9c%82%e9%b8%a3%e5%99%a8%e7%9a%84%e6%8e%a7%e5%88%b6%e7%a8%8b%e5%ba%8f%e4%b8%8e%e9%a9%b1%e5%8a%a8%e7%94%b5%e8%b7%af%e5%9b%be","status":"publish","type":"post","link":"http:\/\/www.szryc.com\/?p=1493","title":{"rendered":"\u5355\u7247\u673a\u8702\u9e23\u5668\u7684\u63a7\u5236\u7a0b\u5e8f\u4e0e\u9a71\u52a8\u7535\u8def\u56fe"},"content":{"rendered":"

\n\t \u8702\u9e23\u5668\u4ece\u7ed3\u6784\u533a\u5206\u5206\u4e3a\u538b\u7535\u5f0f\u8702\u9e23\u5668\u548c\u7535\u78c1\u5f0f\u8702\u9e23\u5668\u3002\u538b\u7535\u5f0f\u4e3a\u538b\u7535\u9676\u74f7\u7247\u53d1\u97f3\uff0c\u7535\u6d41\u6bd4\u8f83\u5c0f\u4e00\u4e9b\uff0c\u7535\u78c1\u5f0f\u8702\u9e23\u5668\u4e3a\u7ebf\u5708\u901a\u7535\u9707\u52a8\u53d1\u97f3\uff0c\u4f53\u79ef\u6bd4\u8f83\u5c0f\u3002<\/p>\n

\n\t\u6309\u7167\u9a71\u52a8\u65b9\u5f0f\u5206\u4e3a\u6709\u6e90\u8702\u9e23\u5668\u548c\u65e0\u6e90\u8702\u9e23\u5668\u3002\u8fd9\u91cc\u7684\u6709\u6e90\u548c\u65e0\u6e90\u4e0d\u662f\u6307\u7535\u6e90\uff0c\u800c\u662f\u632f\u8361\u6e90\u3002\u6709\u6e90\u8702\u9e23\u5668\u5185\u90e8\u5e26\u4e86\u632f\u8361\u6e90\uff0c\u5982\u56fe1\u4e2d\u6240\u793a\uff0c\u7ed9\u4e86 BUZZ \u5f15\u811a\u4e00\u4e2a\u4f4e\u7535\u5e73\uff0c\u8702\u9e23\u5668\u5c31\u4f1a\u76f4\u63a5\u54cd\u3002\u800c\u65e0\u6e90\u8702\u9e23\u5668\u5185\u90e8\u662f\u4e0d\u5e26\u632f\u8361\u6e90\u7684\uff0c\u8981\u8ba9\u4ed6\u54cd\u5fc5\u987b\u7ed9 500Hz\uff5e4.5KHz \u4e4b\u95f4\u7684\u8109\u51b2\u9891\u7387\u4fe1\u53f7\u6765\u9a71\u52a8\u5b83\u624d\u4f1a\u54cd\u3002\u6709\u6e90\u8702\u9e23\u5668\u5f80\u5f80\u6bd4\u65e0\u6e90\u8702\u9e23\u5668\u8d35\u4e00\u4e9b\uff0c\u56e0\u4e3a\u91cc\u8fb9\u591a\u4e86\u632f\u8361\u7535\u8def\uff0c\u9a71\u52a8\u53d1\u97f3\u4e5f\u7b80\u5355\uff0c\u9760\u7535\u5e73\u5c31\u53ef\u4ee5\u9a71\u52a8\uff0c\u800c\u65e0\u6e90\u8702\u9e23\u5668\u4ef7\u683c\u6bd4\u8f83\u4fbf\u5b9c\uff0c\u6b64\u5916\u65e0\u6e90\u8702\u9e23\u5668\u58f0\u97f3\u9891\u7387\u53ef\u4ee5\u63a7\u5236\uff0c\u800c\u97f3\u9636\u4e0e\u9891\u7387\u53c8\u6709\u786e\u5b9a\u7684\u5bf9\u5e94\u5173\u7cfb\uff0c\u56e0\u6b64\u5c31\u53ef\u4ee5\u505a\u51fa\u6765“do re mi fa sol la si”\u7684\u6548\u679c\uff0c\u53ef\u4ee5\u7528\u5b83\u5236\u4f5c\u51fa\u7b80\u5355\u7684\u97f3\u4e50\u66f2\u76ee\uff0c\u6bd4\u5982\u751f\u65e5\u6b4c\u3001\u4e24\u53ea\u8001\u864e\u7b49\u7b49\u3002<\/p>\n

\n\t <\/p>\n

\n\t <\/p>\n


\n\t\"\"<\/center><\/p>\n

\n\t <\/p>\n

\n\t <\/p>\n


\n\t\u56fe1  \u8702\u9e23\u5668\u7535\u8def\u539f\u7406\u56fe<\/center><\/p>\n

\n\t <\/p>\n

\n\t\u6211\u4eec\u6765\u770b\u4e00\u4e0b\u56fe1\u7684\u7535\u8def\uff0c\u8702\u9e23\u5668\u7535\u6d41\u4f9d\u7136\u76f8\u5bf9\u8f83\u5927\uff0c\u56e0\u6b64\u9700\u8981\u7528\u4e09\u6781\u7ba1\u9a71\u52a8\uff0c\u5e76\u4e14\u52a0\u4e86\u4e00\u4e2a 100 \u6b27\u7684\u7535\u963b\u4f5c\u4e3a\u9650\u6d41\u7535\u963b\u3002\u6b64\u5916\u8fd8\u52a0\u4e86\u4e00\u4e2a D4 \u4e8c\u6781\u7ba1\uff0c\u8fd9\u4e2a\u4e8c\u6781\u7ba1\u53eb\u505a\u7eed\u6d41\u4e8c\u6781\u7ba1\u3002\u6211\u4eec\u7684\u8702\u9e23\u5668\u662f\u611f\u6027\u5668\u4ef6\uff0c\u5f53\u4e09\u6781\u7ba1\u5bfc\u901a\u7ed9\u8702\u9e23\u5668\u4f9b\u7535\u65f6\uff0c\u5c31\u4f1a\u6709\u5bfc\u901a\u7535\u6d41\u6d41\u8fc7\u8702\u9e23\u5668\u3002\u800c\u6211\u4eec\u77e5\u9053\uff0c\u7535\u611f\u7684\u4e00\u4e2a\u7279\u70b9\u5c31\u662f\u7535\u6d41\u4e0d\u80fd\u7a81\u53d8\uff0c\u5bfc\u901a\u65f6\u7535\u6d41\u662f\u9010\u6e10\u52a0\u5927\u7684\uff0c\u8fd9\u70b9\u6ca1\u6709\u95ee\u9898\uff0c\u4f46\u5f53\u5173\u65ad\u65f6\uff0c\u7ecf“\u7535\u6e90-\u4e09\u6781\u7ba1-\u8702\u9e23\u5668-\u5730”\u8fd9\u6761\u56de\u8def\u5c31\u622a\u65ad\u4e86\uff0c\u8fc7\u4e0d\u4e86\u4efb\u4f55\u7535\u6d41\u4e86\uff0c\u90a3\u4e48\u50a8\u5b58\u7684\u7535\u6d41\u5f80\u54ea\u513f\u53bb\u5462\uff0c\u5c31\u662f\u7ecf\u8fc7\u8fd9\u4e2a D4 \u548c\u8702\u9e23\u5668\u81ea\u8eab\u7684\u73af\u8def\u6765\u6d88\u8017\u6389\u4e86\uff0c\u4ece\u800c\u5c31\u907f\u514d\u4e86\u5173\u65ad\u65f6\u7531\u4e8e\u7535\u611f\u7535\u6d41\u9020\u6210\u7684\u53cd\u5411\u51b2\u51fb\u3002\u63a5\u7eed\u5173\u65ad\u65f6\u7684\u7535\u6d41\uff0c\u8fd9\u5c31\u662f\u7eed\u6d41\u4e8c\u6781\u7ba1\u540d\u79f0\u7684\u7531\u6765\u3002<\/p>\n

\n\t\u8702\u9e23\u5668\u7ecf\u5e38\u7528\u4e8e\u7535\u8111\u3001\u6253\u5370\u673a\u3001\u4e07\u7528\u8868\u8fd9\u4e9b\u8bbe\u5907\u4e0a\u505a\u63d0\u793a\u97f3\uff0c\u63d0\u793a\u97f3\u4e00\u822c\u4e5f\u5f88\u7b80\u5355\uff0c\u5c31\u662f\u7b80\u5355\u53d1\u51fa\u4e2a\u58f0\u97f3\u5c31\u884c\uff0c\u6211\u4eec\u7528\u7a0b\u5e8f\u7b80\u5355\u505a\u4e86\u4e2a 4KHZ \u9891\u7387\u4e0b\u7684\u53d1\u58f0\u548c 1KHZ \u9891\u7387\u4e0b\u7684\u53d1\u58f0\u7a0b\u5e8f\uff0c\u540c\u5b66\u4eec\u53ef\u4ee5\u81ea\u5df1\u7814\u7a76\u4e0b\u7a0b\u5e8f\uff0c\u6bd4\u8f83\u4e0b\u5b9e\u9645\u6548\u679c\u3002<\/p>\n

\n\t#include<\/p>\n

\n\tsbit BUZZ = P1^6; \/\/\u8702\u9e23\u5668\u63a7\u5236\u5f15\u811a<\/p>\n

\n\tunsigned char T0RH = 0; \/\/T0 \u91cd\u8f7d\u503c\u7684\u9ad8\u5b57\u8282<\/p>\n

\n\tunsigned char T0RL = 0; \/\/T0 \u91cd\u8f7d\u503c\u7684\u4f4e\u5b57\u8282<\/p>\n

\n\tvoid OpenBuzz(unsigned int frequ);<\/p>\n

\n\tvoid StopBuzz();<\/p>\n

\n\tvoid main(){<\/p>\n

\n\tunsigned int i;<\/p>\n

\n\tTMOD = 0x01; \/\/\u914d\u7f6e T0 \u5de5\u4f5c\u5728\u6a21\u5f0f 1\uff0c\u4f46\u5148\u4e0d\u542f\u52a8<\/p>\n

\n\tEA = 1;<\/p>\n

\n\twhile (1){ \/\/\u4f7f\u80fd\u5168\u5c40\u4e2d\u65ad<\/p>\n

\n\tOpenBuzz(4000); \/\/\u4ee5 4KHz \u7684\u9891\u7387\u542f\u52a8\u8702\u9e23\u5668<\/p>\n

\n\tfor (i=0; i<40000; i++);<\/p>\n

\n\tStopBuzz(); \/\/\u505c\u6b62\u8702\u9e23\u5668<\/p>\n

\n\tfor (i=0; i<40000; i++);<\/p>\n

\n\tOpenBuzz(1000); \/\/\u4ee5 1KHz \u7684\u9891\u7387\u542f\u52a8\u8702\u9e23\u5668<\/p>\n

\n\tfor (i=0; i<40000; i++);<\/p>\n

\n\tStopBuzz(); \/\/\u505c\u6b62\u8702\u9e23\u5668<\/p>\n

\n\tfor (i=0; i<40000; i++);<\/p>\n

\n\t}<\/p>\n

\n\t}<\/p>\n

\n\t\/* \u8702\u9e23\u5668\u542f\u52a8\u51fd\u6570\uff0cfrequ-\u5de5\u4f5c\u9891\u7387 *\/<\/p>\n

\n\tvoid OpenBuzz(unsigned int frequ){<\/p>\n

\n\tunsigned int reload;\/\/\u8ba1\u7b97\u6240\u9700\u7684\u5b9a\u65f6\u5668\u91cd\u8f7d\u503c<\/p>\n

\n\treload = 65536 - (11059200\/12)\/(frequ*2); \/\/\u7531\u7ed9\u5b9a\u9891\u7387\u8ba1\u7b97\u5b9a\u65f6\u5668\u91cd\u8f7d\u503c<\/p>\n

\n\tT0RH = (unsigned char)(reload >> 8); \/\/16 \u4f4d\u91cd\u8f7d\u503c\u5206\u89e3\u4e3a\u9ad8\u4f4e\u4e24\u4e2a\u5b57\u8282<\/p>\n

\n\tT0RL = (unsigned char)reload;<\/p>\n

\n\tTH0 = 0xFF; \/\/\u8bbe\u5b9a\u4e00\u4e2a\u63a5\u8fd1\u6ea2\u51fa\u7684\u521d\u503c\uff0c\u4ee5\u4f7f\u5b9a\u65f6\u5668\u9a6c\u4e0a\u6295\u5165\u5de5\u4f5c<\/p>\n

\n\tTL0 = 0xFE;<\/p>\n

\n\tET0 = 1; \/\/\u4f7f\u80fd T0 \u4e2d\u65ad<\/p>\n

\n\tTR0 = 1; \/\/\u542f\u52a8 T0<\/p>\n

\n\t}<\/p>\n

\n\t\/* \u8702\u9e23\u5668\u505c\u6b62\u51fd\u6570 *\/<\/p>\n

\n\tvoid StopBuzz(){<\/p>\n

\n\tET0 = 0; \/\/\u7981\u7528 T0 \u4e2d\u65ad<\/p>\n

\n\tTR0 = 0; \/\/\u505c\u6b62 T0<\/p>\n

\n\t}<\/p>\n

\n\t\/* T0 \u4e2d\u65ad\u670d\u52a1\u51fd\u6570\uff0c\u7528\u4e8e\u63a7\u5236\u8702\u9e23\u5668\u53d1\u58f0 *\/<\/p>\n

\n\tvoid InterruptTimer0() interrupt 1{<\/p>\n

\n\tTH0 = T0RH; \/\/\u91cd\u65b0\u52a0\u8f7d\u91cd\u8f7d\u503c<\/p>\n

\n\tTL0 = T0RL;<\/p>\n

\n\tBUZZ = ~BUZZ; \/\/\u53cd\u8f6c\u8702\u9e23\u5668\u63a7\u5236\u7535\u5e73<\/p>\n

\n\t}<\/p>\n

\n\t\u53e6\u5916\u7528\u8702\u9e23\u5668\u6765\u8f93\u51fa\u97f3\u4e50\uff0c\u4ec5\u4ec5\u662f\u597d\u73a9\u800c\u5df2\uff0c\u5e94\u7528\u5f88\u5c11\uff0c\u91cc\u8fb9\u5305\u542b\u4e86\u97f3\u9636\u3001\u4e50\u8c31\u7684\u76f8\u5173\u5185\u5bb9\uff0c\u7a0b\u5e8f\u4e5f\u6709\u4e00\u70b9\u590d\u6742\uff0c\u6240\u4ee5\u5c31\u4e0d\u8be6\u7ec6\u7ed9\u5927\u5bb6\u53bb\u8bb2\u89e3\u4e86\u3002\u4ec5\u63d0\u4f9b\u4e00\u4e2a\u53ef\u4ee5\u64ad\u653e\u300a\u4e24\u53ea\u8001\u864e\u300b\u7684\u7a0b\u5e8f\uff0c\u5927\u5bb6\u53ef\u4ee5\u4e0b\u8f7d\u5230\u677f\u5b50\u4e0a\u73a9\u73a9\uff0c\u6ee1\u8db3\u4e00\u4e0b\u597d\u5947\u5fc3\u3002<\/p>\n

\n\t\u7eaf\u6587\u672c\u590d\u5236<\/p>\n

\n\t#include<\/p>\n

\n\tsbit BUZZ = P1^6; \/\/\u8702\u9e23\u5668\u63a7\u5236\u5f15\u811a<\/p>\n

\n\tunsigned int code NoteFrequ[] = { \/\/\u4e2d\u97f3 1-7 \u548c\u9ad8\u97f3 1-7 \u5bf9\u5e94\u9891\u7387\u5217\u8868<\/p>\n

\n\t523, 587, 659, 698, 784, 880, 988, \/\/\u4e2d\u97f3 1-7<\/p>\n

\n\t1047, 1175, 1319, 1397, 1568, 1760, 1976 \/\/\u9ad8\u97f3 1-7<\/p>\n

\n\t};<\/p>\n

\n\tunsigned int code NoteReload[] = { \/\/\u4e2d\u97f3 1-7 \u548c\u9ad8\u97f3 1-7 \u5bf9\u5e94\u7684\u5b9a\u65f6\u5668\u91cd\u8f7d\u503c<\/p>\n

\n\t65536 - (11059200\/12) \/ (523*2), \/\/\u4e2d\u97f3 1<\/p>\n

\n\t65536 - (11059200\/12) \/ (587*2), \/\/2<\/p>\n

\n\t65536 - (11059200\/12) \/ (659*2), \/\/3<\/p>\n

\n\t65536 - (11059200\/12) \/ (698*2), \/\/4<\/p>\n

\n\t65536 - (11059200\/12) \/ (784*2), \/\/5<\/p>\n

\n\t65536 - (11059200\/12) \/ (880*2), \/\/6<\/p>\n

\n\t65536 - (11059200\/12) \/ (988*2), \/\/7<\/p>\n

\n\t65536 - (11059200\/12) \/ (1047*2), \/\/\u9ad8\u97f3 1<\/p>\n

\n\t65536 - (11059200\/12) \/ (1175*2), \/\/2<\/p>\n

\n\t65536 - (11059200\/12) \/ (1319*2), \/\/3<\/p>\n

\n\t65536 - (11059200\/12) \/ (1397*2), \/\/4<\/p>\n

\n\t65536 - (11059200\/12) \/ (1568*2), \/\/5<\/p>\n

\n\t65536 - (11059200\/12) \/ (1760*2), \/\/6<\/p>\n

\n\t65536 - (11059200\/12) \/ (1976*2), \/\/7<\/p>\n

\n\t};<\/p>\n

\n\tbit enable = 1; \/\/\u8702\u9e23\u5668\u53d1\u58f0\u4f7f\u80fd\u6807\u5fd7<\/p>\n

\n\tbit tmrflag = 0; \/\/\u5b9a\u65f6\u5668\u4e2d\u65ad\u5b8c\u6210\u6807\u5fd7<\/p>\n

\n\tunsigned char T0RH = 0xFF; \/\/T0 \u91cd\u8f7d\u503c\u7684\u9ad8\u5b57\u8282<\/p>\n

\n\tunsigned char T0RL = 0x00; \/\/T0 \u91cd\u8f7d\u503c\u7684\u4f4e\u5b57\u8282<\/p>\n

\n\tvoid PlayTwoTiger();<\/p>\n

\n\tvoid main(){<\/p>\n

\n\tunsigned int i;<\/p>\n

\n\tEA = 1; \/\/\u4f7f\u80fd\u5168\u5c40\u4e2d\u65ad<\/p>\n

\n\tTMOD = 0x01; \/\/\u914d\u7f6e T0 \u5de5\u4f5c\u5728\u6a21\u5f0f 1<\/p>\n

\n\tTH0 = T0RH;<\/p>\n

\n\tTL0 = T0RL;<\/p>\n

\n\tET0 = 1; \/\/\u4f7f\u80fd T0 \u4e2d\u65ad<\/p>\n

\n\tTR0 = 1; \/\/\u542f\u52a8 T0<\/p>\n

\n\twhile (1){<\/p>\n

\n\tPlayTwoTiger(); \/\/\u64ad\u653e\u4e50\u66f2--\u4e24\u652f\u8001\u864e<\/p>\n

\n\tfor (i=0; i<40000; i++); \/\/\u505c\u6b62\u4e00\u6bb5\u65f6\u95f4<\/p>\n

\n\t}<\/p>\n

\n\t}<\/p>\n

\n\t\/* \u4e24\u652f\u8001\u864e\u4e50\u66f2\u64ad\u653e\u51fd\u6570 *\/<\/p>\n

\n\tvoid PlayTwoTiger(){<\/p>\n

\n\tunsigned char beat; \/\/\u5f53\u524d\u8282\u62cd\u7d22\u5f15<\/p>\n

\n\tunsigned char note; \/\/\u5f53\u524d\u8282\u62cd\u5bf9\u5e94\u7684\u97f3\u7b26<\/p>\n

\n\tunsigned int time = 0; \/\/\u5f53\u524d\u8282\u62cd\u8ba1\u65f6<\/p>\n

\n\tunsigned int beatTime = 0; \/\/\u5f53\u524d\u8282\u62cd\u603b\u65f6\u95f4<\/p>\n

\n\tunsigned int soundTime = 0; \/\/\u5f53\u524d\u8282\u62cd\u9700\u53d1\u58f0\u65f6\u95f4<\/p>\n

\n\t\/\/\u4e24\u53ea\u8001\u864e\u97f3\u7b26\u8868<\/p>\n

\n\tunsigned char code TwoTigerNote[] = {<\/p>\n

\n\t1, 2, 3, 1, 1, 2, 3, 1, 3, 4, 5, 3, 4, 5,<\/p>\n

\n\t5,6, 5,4, 3, 1, 5,6, 5,4, 3, 1, 1, 5, 1, 1, 5, 1,<\/p>\n

\n\t};<\/p>\n

\n\t\/\/\u4e24\u53ea\u8001\u864e\u8282\u62cd\u8868\uff0c4 \u8868\u793a\u4e00\u62cd\uff0c1 \u5c31\u662f 1\/4 \u62cd\uff0c8 \u5c31\u662f 2 \u62cd<\/p>\n

\n\tunsigned char code TwoTigerBeat[] = {<\/p>\n

\n\t4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 4, 4, 8,<\/p>\n

\n\t3,1, 3,1, 4, 4, 3,1, 3,1, 4, 4, 4, 4, 8, 4, 4, 8,<\/p>\n

\n\t};<\/p>\n

\n\t\/\/\u7528\u8282\u62cd\u7d22\u5f15\u4f5c\u4e3a\u5faa\u73af\u53d8\u91cf<\/p>\n

\n\tfor (beat=0; beat<\/p>\n

\n\twhile (!tmrflag); \/\/\u6bcf\u6b21\u5b9a\u65f6\u5668\u4e2d\u65ad\u5b8c\u6210\u540e\uff0c\u68c0\u6d4b\u5e76\u5904\u7406\u8282\u62cd<\/p>\n

\n\ttmrflag = 0;<\/p>\n

\n\tif (time == 0){ \/\/\u5f53\u524d\u8282\u62cd\u64ad\u5b8c\u5219\u542f\u52a8\u4e00\u4e2a\u65b0\u8282\u62cd<\/p>\n

\n\tnote = TwoTigerNote[beat] - 1;<\/p>\n

\n\tT0RH = NoteReload[note] >> 8;<\/p>\n

\n\tT0RL = NoteReload[note];<\/p>\n

\n\t\/\/\u8ba1\u7b97\u8282\u62cd\u603b\u65f6\u95f4\uff0c\u53f3\u79fb 2 \u4f4d\u76f8\u5f53\u4e8e\u9664 4\uff0c\u79fb\u4f4d\u4ee3\u66ff\u9664\u6cd5\u53ef\u4ee5\u52a0\u5feb\u6267\u884c\u901f\u5ea6<\/p>\n

\n\tbeatTime = (TwoTigerBeat[beat] * NoteFrequ[note]) >> 2;<\/p>\n

\n\t\/\/\u8ba1\u7b97\u53d1\u58f0\u65f6\u95f4\uff0c\u4e3a\u603b\u65f6\u95f4\u7684 0.75\uff0c\u79fb\u4f4d\u539f\u7406\u540c\u4e0a<\/p>\n

\n\tsoundTime = beatTime - (beatTime >> 2);<\/p>\n

\n\tenable = 1; \/\/\u6307\u793a\u8702\u9e23\u5668\u5f00\u59cb\u53d1\u58f0<\/p>\n

\n\ttime++;<\/p>\n

\n\t}else{ \/\/\u5f53\u524d\u8282\u62cd\u672a\u64ad\u5b8c\u5219\u5904\u7406\u5f53\u524d\u8282\u62cd<\/p>\n

\n\t\/\/\u5f53\u524d\u6301\u7eed\u65f6\u95f4\u5230\u8fbe\u8282\u62cd\u603b\u65f6\u95f4\u65f6\u5f52\u96f6\uff0c<\/p>\n

\n\t\/\/\u5e76\u9012\u589e\u8282\u62cd\u7d22\u5f15\uff0c\u4ee5\u51c6\u5907\u542f\u52a8\u65b0\u8282\u62cd<\/p>\n

\n\tif (time >= beatTime){<\/p>\n

\n\ttime = 0;<\/p>\n

\n\tbeat++;<\/p>\n

\n\t}else{ \/\/\u5f53\u524d\u6301\u7eed\u65f6\u95f4\u672a\u8fbe\u5230\u603b\u65f6\u95f4\u65f6\uff0c<\/p>\n

\n\ttime++; \/\/\u7d2f\u52a0\u65f6\u95f4\u8ba1\u6570<\/p>\n

\n\t\/\/\u5230\u8fbe\u53d1\u58f0\u65f6\u95f4\u540e\uff0c\u6307\u793a\u5173\u95ed\u8702\u9e23\u5668\uff0c<\/p>\n

\n\t\/\/\u63d2\u5165 0.25*\u603b\u65f6\u95f4\u7684\u9759\u97f3\u95f4\u9694\uff0c<\/p>\n

\n\tif (time == soundTime){<\/p>\n

\n\tenable = 0; \/\/\u7528\u4ee5\u533a\u5206\u8fde\u7eed\u7684\u4e24\u4e2a\u8282\u62cd<\/p>\n

\n\t}<\/p>\n

\n\t}<\/p>\n

\n\t}<\/p>\n

\n\t}<\/p>\n

\n\t}<\/p>\n

\n\t\/* T0 \u4e2d\u65ad\u670d\u52a1\u51fd\u6570\uff0c\u7528\u4e8e\u63a7\u5236\u8702\u9e23\u5668\u53d1\u58f0 *\/<\/p>\n

\n\tvoid InterruptTimer0() interrupt 1{<\/p>\n

\n\tTH0 = T0RH; \/\/\u91cd\u65b0\u52a0\u8f7d\u91cd\u8f7d\u503c<\/p>\n

\n\tTL0 = T0RL;<\/p>\n

\n\ttmrflag = 1;<\/p>\n

\n\tif (enable){ \/\/\u4f7f\u80fd\u65f6\u53cd\u8f6c\u8702\u9e23\u5668\u63a7\u5236\u7535\u5e73<\/p>\n

\n\tBUZZ = ~BUZZ;<\/p>\n

\n\t}else{ \/\/\u672a\u4f7f\u80fd\u65f6\u5173\u95ed\u8702\u9e23\u5668<\/p>\n

\n\tBUZZ = 1;<\/p>\n

\n\t}<\/p>\n

\n\t}<\/p>\n","protected":false},"excerpt":{"rendered":"

\u8702\u9e23\u5668\u4ece\u7ed3\u6784\u533a\u5206\u5206\u4e3a\u538b\u7535\u5f0f\u8702\u9e23\u5668\u548c\u7535\u78c1\u5f0f\u8702\u9e23\u5668\u3002\u538b\u7535\u5f0f\u4e3a\u538b\u7535\u9676\u74f7\u7247\u53d1\u97f3\uff0c\u7535\u6d41\u6bd4\u8f83\u5c0f\u4e00\u4e9b\uff0c\u7535\u78c1\u5f0f\u8702\u9e23\u5668\u4e3a\u7ebf\u5708\u901a\u7535\u9707\u52a8\u53d1\u97f3\uff0c\u4f53\u79ef\u6bd4\u8f83\u5c0f\u3002 \u6309\u7167\u9a71\u52a8\u65b9\u5f0f\u5206\u4e3a\u6709\u6e90\u8702\u9e23\u5668\u548c\u65e0<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"_links":{"self":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/1493"}],"collection":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1493"}],"version-history":[{"count":0,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/1493\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1493"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1493"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1493"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}