{"id":2862,"date":"2019-10-27T15:02:50","date_gmt":"2019-10-27T15:02:50","guid":{"rendered":""},"modified":"2019-10-27T23:03:16","modified_gmt":"2019-10-27T15:03:16","slug":"%e5%9f%ba%e4%ba%8e51%e5%8d%95%e7%89%87%e6%9c%ba%e7%9a%84%e8%ae%a1%e6%97%b6%e5%99%a8%e8%ae%be%e8%ae%a1","status":"publish","type":"post","link":"http:\/\/www.szryc.com\/?p=2862","title":{"rendered":"\u57fa\u4e8e51\u5355\u7247\u673a\u7684\u8ba1\u65f6\u5668\u8bbe\u8ba1"},"content":{"rendered":"

\n\t\u752851\u5355\u7247\u673a<\/u>\u7684\u5b9a\u65f6\u5668<\/u>0\u7684\u65b9\u5f0f1\u8ba1\u65f6<\/u>\uff0c\u7ed3\u679c\u75284\u4f4d\u6570\u7801\u7ba1\u663e\u793a\uff0c\u5206\u522b\u4e3a\u79d2\u5341\u4f4d\uff0c\u79d2\u4e2a\u4f4d\uff0c\u6beb\u79d2\u767e\u4f4d\uff0c\u6beb\u79d2\u5341\u4f4d\u3002\u6240\u4ee5\u603b\u5171\u6700\u5927\u8ba1\u65f6\u4e3a1\u5206\u949f\uff0c\u7cbe\u786e\u5230\u4e860.01s\u3002\u540c\u65f6\uff0c\u52a0\u4e0a3\u4e2a\u72ec\u7acb\u6309\u952e\uff0c\u5206\u522b\u63a7\u5236\u79d2\u8868\u7684\u6e05\u96f6\uff0c\u6682\u505c\u548c\u5f00\u59cb\u529f\u80fd\u3002<\/p>\n

\n\t\u6309\u7167\u6a21\u5757\u5316<\/u>\u7684\u601d\u60f3\uff0c\u9996\u5148\u5148\u628a\u8981\u7528\u7684\u51fd\u6570\u548c\u9884\u5b9a\u4e49\u5199\u5230\u4e00\u4e2a\u5934\u6587\u4ef6\u4e2d\uff0c\u8981\u7528\u5230\u7684\u9884\u5b9a\u4e49\u548c\u5168\u5c40\u53d8\u91cf\u5982\u4e0b\uff1a<\/p>\n

\n\t <\/div>\n

\n\t\"\u57fa\u4e8e51\u5355\u7247\u673a\u7684\u8ba1\u65f6\u5668\u8bbe\u8ba1\"<\/p>\n

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

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

\n\tsbitClear=P3^7;\/\/\u6309\u952e\u5b9e\u73b0\u6e05\u96f6<\/p>\n

\n\tsbitStop=P3^6;\/\/\u6309\u952e\u5b9e\u73b0\u6682\u505c<\/p>\n

\n\tsbitReStart=P3^5;\/\/\u6309\u952e\u5b9e\u73b0\u5f00\u59cb<\/p>\n

\n\tsbitdula=P2^6;\/\/\u6bb5\u9009\u7ebf\u63a5P2^6\u53e3<\/p>\n

\n\tsbitwela=P2^7;\/\/\u4f4d\u9009\u7ebf\u63a5P2^7\u53e3<\/p>\n

\n\t\/\/table\u6570\u7ec4\u4e2d\u5b58\u50a8<\/u>\u6570\u7801\u7ba1\u663e\u793a0~F\u5bf9\u5e94\u7684\u7f16\u7801<\/p>\n

\n\tucharcodetable[]={<\/p>\n

\n\t0x3f,0x06,0x5b,0x4f,<\/p>\n

\n\t0x66,0x6d,0x7d,0x07,<\/p>\n

\n\t0x7f,0x6f,0x77,0x7c,<\/p>\n

\n\t0x39,0x5e,0x79,0x71};<\/p>\n

\n\t\/\/\u8ba1\u65f6\u65f6\u95f4\uff0c\u8ba1\u65f6\u4e2d\u65ad\u53d1\u751f\u4e00\u6b21\uff0c\u5219\u52a01\uff0c\u6700\u5927\u4e3a5999<\/p>\n

\n\tintti<\/u>me;<\/p>\n

\n\t\u63a5\u4e0b\u6765\u662f\u5c06\u8981\u7528\u5230\u7684\u51fd\u6570\u58f0\u660e\uff1a<\/p>\n

\n\t\/\/\u7528\u4e8e\u52a8\u6001\u626b\u63cf\u6570\u7801\u7ba1\u7684\u65f6\u95f4\u8f83\u77ed\u7684\u5ef6\u65f6\u51fd\u6570<\/p>\n

\n\tvoidShortDelay();<\/p>\n

\n\t\/\/\u7528\u4e8e\u952e\u76d8\u6d88\u6296\u7684\u65f6\u95f4\u8f83\u957f\u7684\u5ef6\u65f6\u51fd\u6570<\/p>\n

\n\tvoidLongDelay();<\/p>\n

\n\t\/\/\u521d\u59cb\u5316<\/p>\n

\n\tvoidInital();<\/p>\n

\n\t\/\/\u5728\u6570\u7801\u7ba1\u663e\u793a\u79d2\u5341\u4f4d\uff0c\u79d2\u4e2a\u4f4d\uff0c\u5fae\u79d2\u767e\u4f4d\uff0c\u5fae\u79d2\u5341\u4f4d<\/p>\n

\n\t\/\/\u7528\u62fc\u97f3\u8868\u793a\u5f88\u4e0d\u597d\uff0c\u5c06\u5c31\u7740\u770b\u5427<\/p>\n

\n\tvoidDisplay(uchars<\/u>himi<\/u>ao,uchargemiao,ucharbai<\/u>wei,ucharshiwei);<\/p>\n

\n\t\/\/\u6e05\u96f6\u51fd\u6570\uff0c\u6309\u4e0b\u6e05\u96f6\u952e\u7684\u65f6\u5019\u8c03\u7528<\/p>\n

\n\tvoidC<\/u>lc();<\/p>\n

\n\t\/\/\u6682\u505c\u51fd\u6570\uff0c\u6309\u4e0b\u6682\u505c\u952e\u65f6\u5019\u8c03\u7528<\/p>\n

\n\tvoidStopTImer();<\/p>\n

\n\t\/\/\u5f00\u59cb\u6216\u91cd\u65b0\u5f00\u59cb\u51fd\u6570\uff0c\u6309\u4e0b\u5f00\u59cb\u952e\u65f6\u5019\u8c03\u7528<\/p>\n

\n\tvoidReStartTImer();<\/p>\n

\n\t\/\/\u952e\u76d8\u626b\u63cf\u51fd\u6570\uff0c\u662f\u5426\u6709\u952e\u88ab\u6309\u4e0b\uff0c\u5e76\u4e14\u6267\u884c\u76f8\u5e94\u64cd\u4f5c<\/p>\n

\n\tvoidKeyScan<\/u>();<\/p>\n

\n\t\u63a5\u4e0b\u6765\u662f\u4e3b\u51fd\u6570\uff1a<\/p>\n

\n\tvoidma<\/u>in()<\/p>\n

\n\t{<\/p>\n

\n\tucharshimiao,gemiao,baiwei,shiwei;<\/p>\n

\n\tInital();\/\/\u521d\u59cb\u5316<\/p>\n

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

\n\t{<\/p>\n

\n\tif<\/u>(TIme==6000)\/\/\u5230\u4e86\u79d2\u8868\u6700\u5927\u503c\uff0c\u81ea\u52a8\u5f52\u96f6<\/p>\n

\n\t{<\/p>\n

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

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

\n\t\/\/\u5206\u89e3\u51fa\u8981\u663e\u793a\u7684\u5404\u4e2a\u6570\u4f4d<\/p>\n

\n\tshimiao=time\/1000;<\/p>\n

\n\tgemiao=time%1000\/100;<\/p>\n

\n\tbaiwei=time%100\/10;<\/p>\n

\n\tshiwei=time%10;<\/p>\n

\n\t\/\/\u663e\u793a<\/p>\n

\n\tDisplay(shimiao,gemiao,baiwei,shiwei);<\/p>\n

\n\tShortDelay();<\/p>\n

\n\t\/\/\u952e\u76d8\u626b\u63cf\uff0c\u6709\u952e\u6309\u4e0b\u6267\u884c\u76f8\u5e94\u64cd\u4f5c<\/p>\n

\n\tKeyScan();<\/p>\n

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

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

\n\t
\n\t\u4e0b\u9762\u7684\u5de5\u4f5c\u5c31\u662f\u8981\u5199\u76f8\u5e94\u7684\u5904\u7406\u51fd\u6570\u4e86\uff1a<\/p>\n

\n\t\u9996\u5148\u662f\u4e24\u4e2a\u5ef6\u65f6\u51fd\u6570\uff1a<\/p>\n

\n\tvoidShortDelay()<\/p>\n

\n\t{<\/p>\n

\n\tuchara=100;<\/p>\n

\n\twhile(a--);<\/p>\n

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

\n\tvoidLongDelay()<\/p>\n

\n\t{<\/p>\n

\n\tinta=5000;<\/p>\n

\n\twhile(a--);<\/p>\n

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

\n\t
\n\t\u521d\u59cb\u5316\u51fd\u6570\uff1a<\/p>\n

\n\tvoidInital()<\/p>\n

\n\t{<\/p>\n

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

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

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

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

\n\tET0=1;\/\/\u5f00\u5b9a\u65f6\u56680\u4e2d\u65ad<\/p>\n

\n\tTMOD=0x01;<\/p>\n

\n\tTH0=0xdc;<\/p>\n

\n\tTL0=0x01;\/\/\u88c5\u8f7d\u521d\u503c\uff0c\u8ba1\u65f6\u65b9\u5f0f1<\/p>\n

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

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

\n\tReStart=1;\/\/\u6309\u952e\u63a5\u53e3<\/u>\u7ba1\u811a\u8f93\u51fa\u9ad8\u7535\u5e73<\/p>\n

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

\n\t
\n\t\u5728\u6570\u7801\u7ba1\u4e0a\u663e\u793a\u65f6\u95f4\u7684\u51fd\u6570\uff1a<\/p>\n

\n\tvoidDisplay(ucharshimiao,uchargemiao,ucharbaiwei,ucharshiwei)<\/p>\n

\n\t{<\/p>\n

\n\t\/\/\u8f93\u51fa\u79d2\u5341\u4f4d<\/p>\n

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

\n\tP0=0xfb;<\/p>\n

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

\n\tP0=0xff;<\/p>\n

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

\n\tP0=table[shimiao];<\/p>\n

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

\n\tShortDelay();<\/p>\n

\n\t\/\/\u8f93\u51fa\u79d2\u4e2a\u4f4d<\/p>\n

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

\n\tP0=0xf7;<\/p>\n

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

\n\tP0=0xff;<\/p>\n

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

\n\tP0=table[gemiao];<\/p>\n

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

\n\tShortDelay();<\/p>\n

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

\n\tP0=0xef;<\/p>\n

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

\n\tP0=0xff;<\/p>\n

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

\n\tP0=table[baiwei];<\/p>\n

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

\n\tShortDelay();<\/p>\n

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

\n\tP0=0xdf;<\/p>\n

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

\n\tP0=0xff;<\/p>\n

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

\n\tP0=table[shiwei];<\/p>\n

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

\n\tShortDelay();<\/p>\n

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

\n\t
\n\t\u952e\u76d8\u626b\u63cf\u51fd\u6570\uff1a<\/p>\n

\n\tvoidKeyScan()<\/p>\n

\n\t{<\/p>\n

\n\tif(Clear==0)<\/p>\n

\n\t{<\/p>\n

\n\tLongDelay();\/\/\u6d88\u6296<\/p>\n

\n\tif(Clear==0)\/\/\u786e\u5b9e\u662f\u88ab\u6309\u4e0b<\/p>\n

\n\t{<\/p>\n

\n\t\/\/Dosomthing<\/p>\n

\n\tClc();<\/p>\n

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

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

\n\t\/\/Stop\u548cReStart\u68c0\u6d4b\u65b9\u6cd5\u76f8\u540c<\/p>\n

\n\tif(Stop==0)<\/p>\n

\n\t{<\/p>\n

\n\tLongDelay();<\/p>\n

\n\tif(Stop==0)<\/p>\n

\n\t{<\/p>\n

\n\t\/\/Dosomthing<\/p>\n

\n\tStopTimer();<\/p>\n

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

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

\n\tif(ReStart==0)<\/p>\n

\n\t{<\/p>\n

\n\tLongDelay();<\/p>\n

\n\tif(ReStart==0)<\/p>\n

\n\t{<\/p>\n

\n\t\/\/Dosomthing<\/p>\n

\n\tReStartTimer();<\/p>\n

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

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

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

\n\t
\n\t\u6700\u540e\u662f3\u4e2a\u6309\u952e\u6309\u4e0b\u540e\u7684\u5904\u7406\u51fd\u6570\uff1a<\/p>\n

\n\tvoidClc()<\/p>\n

\n\t{<\/p>\n

\n\tTR0=0;\/\/\u8ba1\u65f6\u6682\u65f6\u505c\u6b62<\/p>\n

\n\ttime=0;\/\/\u65f6\u95f4\u5f52\u96f6<\/p>\n

\n\tDisplay(0,0,0,0);\/\/\u663e\u793a0000<\/p>\n

\n\tShortDelay();<\/p>\n

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

\n\tvoidStopTimer()<\/p>\n

\n\t{<\/p>\n

\n\t\/\/\u8ba1\u65f6\u6682\u65f6\u505c\u6b62\uff0c\u4ec5\u6b64\u800c\u5df2<\/p>\n

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

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

\n\tvoidReStartTimer()<\/p>\n

\n\t{<\/p>\n

\n\t\/\/\u8ba1\u65f6\u91cd\u65b0\u5f00\u59cb\uff0c\u4ec5\u6b64\u800c\u5df2<\/p>\n

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

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

\u752851 \u5355\u7247\u673a \u7684 \u5b9a\u65f6\u5668 0\u7684\u65b9\u5f0f1 \u8ba1\u65f6 \uff0c\u7ed3\u679c\u75284\u4f4d\u6570\u7801\u7ba1\u663e\u793a\uff0c\u5206\u522b\u4e3a\u79d2\u5341\u4f4d\uff0c\u79d2\u4e2a\u4f4d\uff0c\u6beb\u79d2\u767e\u4f4d\uff0c\u6beb\u79d2\u5341\u4f4d\u3002\u6240\u4ee5\u603b\u5171\u6700\u5927\u8ba1\u65f6\u4e3a1\u5206\u949f\uff0c\u7cbe\u786e\u5230\u4e860.01s\u3002\u540c\u65f6\uff0c\u52a0\u4e0a3\u4e2a\u72ec\u7acb\u6309\u952e\uff0c\u5206\u522b<\/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\/2862"}],"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=2862"}],"version-history":[{"count":0,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/2862\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2862"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2862"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2862"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}