{"id":2525,"date":"2019-05-28T08:50:45","date_gmt":"2019-05-28T08:50:45","guid":{"rendered":""},"modified":"2019-05-28T16:51:13","modified_gmt":"2019-05-28T08:51:13","slug":"c51%e5%8d%95%e7%89%87%e6%9c%ba%e4%ba%a7%e7%94%9f%e4%b8%8d%e7%94%a8%e6%b3%a2%e5%bd%a2%e5%9b%be%e7%9a%84%e8%ae%be%e8%ae%a1","status":"publish","type":"post","link":"http:\/\/www.szryc.com\/?p=2525","title":{"rendered":"C51\u5355\u7247\u673a\u4ea7\u751f\u4e0d\u7528\u6ce2\u5f62\u56fe\u7684\u8bbe\u8ba1"},"content":{"rendered":"

\n\t\u7528\u5355\u7247\u673a<\/u>\u4ea7\u751f\u65b9\u6ce2\u3001\u952f\u9f7f\u6ce2\u3001\u4e09\u89d2\u6ce2\u3001\u68af\u5f62\u6ce2\uff0c\u9891\u7387\u53ef\u8c03<\/p>\n

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

\n\t <\/div>\n

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

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

\n\tunsignedcharx=0\uff0cm=0\uff0cy=128;<\/p>\n

\n\tsbitWR_DA=P2^1;<\/p>\n

\n\tsbitCS_DA=P2^0;\/\/DA\u4e0e \u5355\u7247\u673a \u7684\u63a5\u53e3<\/p>\n

\n\tsbitS0=P3^0;\/\/\u6ce2\u5f62\u9009\u62e9\uff0c\u6bcf\u6b21\u6309\u4e0b\u5c06\u4ea7\u751f\u4e0d\u540c\u7684\u6ce2\u5f62<\/p>\n

\n\tsbitS1=P3^1;\/\/\u9891\u7387\u51cf<\/p>\n

\n\tsbitS2=P3^2;\/\/\u9891\u7387\u52a0<\/p>\n

\n\tsbitS3=P3^3;\/\/\u8c03\u8282\u65b9\u6ce2\u7684\u5360\u7a7a\u6bd4<\/p>\n

\n\t\"C51\u5355\u7247\u673a\u4ea7\u751f\u4e0d\u7528\u6ce2\u5f62\u56fe\u7684\u8bbe\u8ba1\"<\/p>\n

\n\tucharcodeSinTab\uff3b256\uff3d={0x80\uff0c0x83\uff0c0x86\uff0c0x89\uff0c0x8d\uff0c0x90\uff0c0x93\uff0c0x96\uff0c0x99\uff0c0x9c\uff0c0x9f\uff0c0xa2\uff0c0xa5\uff0c0xa8\uff0c0xab\uff0c0xae\uff0c0xb1\uff0c0xb4\uff0c0xb7\uff0c0xba\uff0c0xbc\uff0c0xbf\uff0c0xc2\uff0c0xc5<\/p>\n

\n\t\uff0c0xc7\uff0c0xca\uff0c0xCC\uff0c0xcf\uff0c0xd1\uff0c0xd4\uff0c0xd6\uff0c0xd8\uff0c0xda\uff0c0xdd\uff0c0xdf\uff0c0xe1\uff0c0xe3\uff0c0xe5\uff0c0xe7\uff0c0xe9\uff0c0xea\uff0c0xec\uff0c0xee\uff0c0xef\uff0c0xf1\uff0c0xf2\uff0c0xf4\uff0c0xf5<\/p>\n

\n\t\uff0c0xf6\uff0c0xf7\uff0c0xf8\uff0c0xf9\uff0c0xfa\uff0c0xfb\uff0c0xfc\uff0c0xfd\uff0c0xfd\uff0c0xfe\uff0c0xff\uff0c0xff\uff0c0xff\uff0c0xff\uff0c0xff\uff0c0xff\uff0c0xff\uff0c0xff\uff0c0xff\uff0c0xff\uff0c0xff\uff0c0xff\uff0c0xfe\uff0c0xfd<\/p>\n

\n\t\uff0c0xfd\uff0c0xfc\uff0c0xfb\uff0c0xfa\uff0c0xf9\uff0c0xf8\uff0c0xf7\uff0c0xf6\uff0c0xf5\uff0c0xf4\uff0c0xf2\uff0c0xf1\uff0c0xef\uff0c0xee\uff0c0xec\uff0c0xea\uff0c0xe9\uff0c0xe7\uff0c0xe5\uff0c0xe3\uff0c0xe1\uff0c0xde\uff0c0xdd\uff0c0xda<\/p>\n

\n\t\uff0c0xd8\uff0c0xd6\uff0c0xd4\uff0c0xd1\uff0c0xcf\uff0c0xcc\uff0c0xca\uff0c0xc7\uff0c0xc5\uff0c0xc2\uff0c0xbf\uff0c0xbc\uff0c0xba\uff0c0xb7\uff0c0xb4\uff0c0xb1\uff0c0xae\uff0c0xab\uff0c0xa8\uff0c0xa5\uff0c0xa2\uff0c0x9f\uff0c0x9c\uff0c0x99<\/p>\n

\n\t\uff0c0x96\uff0c0x93\uff0c0x90\uff0c0x8d\uff0c0x89\uff0c0x86\uff0c0x83\uff0c0x80\uff0c0x80\uff0c0x7c\uff0c0x79\uff0c0x76\uff0c0x72\uff0c0x6f\uff0c0x6c\uff0c0x69\uff0c0x66\uff0c0x63\uff0c0x60\uff0c0x5d\uff0c0x5a\uff0c0x57\uff0c0x55\uff0c0x51<\/p>\n

\n\t\uff0c0x4e\uff0c0x4c\uff0c0x48\uff0c0x45\uff0c0x43\uff0c0x40\uff0c0x3d\uff0c0x3a\uff0c0x38\uff0c0x35\uff0c0x33\uff0c0x30\uff0c0x2e\uff0c0x2b\uff0c0x29\uff0c0x27\uff0c0x25\uff0c0x22\uff0c0x20\uff0c0x1e\uff0c0x1c\uff0c0x1a\uff0c0x18\uff0c0x16<\/p>\n

\n\t\uff0c0x15\uff0c0x13\uff0c0x11\uff0c0x10\uff0c0x0e\uff0c0x0d\uff0c0x0b\uff0c0x0a\uff0c0x09\uff0c0x08\uff0c0x07\uff0c0x06\uff0c0x05\uff0c0x04\uff0c0x03\uff0c0x02\uff0c0x02\uff0c0x01\uff0c0x00\uff0c0x00\uff0c0x00\uff0c0x00\uff0c0x00\uff0c0x00<\/p>\n

\n\t\uff0c0x00\uff0c0x00\uff0c0x00\uff0c0x00\uff0c0x00\uff0c0x00\uff0c0x01\uff0c0x02\uff0c0x02\uff0c0x03\uff0c0x04\uff0c0x05\uff0c0x06\uff0c0x07\uff0c0x08\uff0c0x09\uff0c0x0a\uff0c0x0b\uff0c0x0d\uff0c0x0e\uff0c0x10\uff0c0x11\uff0c0x13\uff0c0x15<\/p>\n

\n\t\uff0c0x16\uff0c0x18\uff0c0x1a\uff0c0x1c\uff0c0x1e\uff0c0x20\uff0c0x22\uff0c0x25\uff0c0x27\uff0c0x29\uff0c0x2b\uff0c0x2e\uff0c0x30\uff0c0x33\uff0c0x35\uff0c0x38\uff0c0x3a\uff0c0x3d\uff0c0x40\uff0c0x43\uff0c0x45\uff0c0x48\uff0c0x4c\uff0c0x4e<\/p>\n

\n\t\uff0c0x51\uff0c0x55\uff0c0x57\uff0c0x5a\uff0c0x5d\uff0c0x60\uff0c0x63\uff0c0x66\uff0c0x69\uff0c0x6c\uff0c0x6f\uff0c0x72\uff0c0x76\uff0c0x79\uff0c0x7c\uff0c0x80};<\/p>\n

\n\tvoiddelayms\uff08uintt\uff09<\/p>\n

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

\n\tuinti<\/u>;<\/p>\n

\n\twhile\uff08t--\uff09<\/p>\n

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

\n\tfor\uff08i=0;i\u300a125;i++\uff09;\/\/\u5bf9\u4e8e11.0592M\u65f6\u949f<\/u>\uff0c\u7ea6\u5ef6\u65f61ms<\/p>\n

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

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

\n\tvoiddelay\uff08uintt\uff09<\/p>\n

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

\n\tuinTI;<\/p>\n

\n\tfor\uff08i=t;i\u300b0;i--\uff09;<\/p>\n

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

\n\tvoidt<\/u>ime0_init\uff08\uff09<\/p>\n

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

\n\tTMOD|=0x01;\/\/\u5b9a\u65f6\u5668<\/u>\u8bbe\u7f6e16\u4f4d<\/p>\n

\n\tTH0=-50000\/256;<\/p>\n

\n\tTL0=-50000%256;\/\/\u521d\u59cb\u5316\u503c<\/p>\n

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

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

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

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

\n\tvoidTIme0_int\uff08void\uff09inte<\/u>rrupt1<\/p>\n

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

\n\tTR0=0;\/\/\u5173\u95ed\u5b9a\u65f6\u5668<\/p>\n

\n\tTH0=-50000\/256;<\/p>\n

\n\tTL0=-50000%256;\/\/\u91cd\u88c5\u521d\u503c<\/p>\n

\n\tif\uff08S0==0\uff09<\/p>\n

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

\n\tdelayms\uff0810\uff09;\/\/\u6309\u952e\u6d88\u6296<\/p>\n

\n\tif\uff08S0==0\uff09m++;<\/p>\n

\n\twhile\uff08\uff01S0\uff09;\/\/\u677e\u624b\u68c0\u6d4b<\/p>\n

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

\n\tif\uff08S1==0\uff09<\/p>\n

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

\n\tdelayms\uff0810\uff09;<\/p>\n

\n\tif\uff08S1==0\uff09x=x+1;<\/p>\n

\n\twhile\uff08\uff01S1\uff09;\/\/\u677e\u624b\u68c0\u6d4b<\/p>\n

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

\n\tif\uff08S2==0\uff09<\/p>\n

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

\n\tdelayms\uff0810\uff09;<\/p>\n

\n\tif\uff08S2==0\uff09x=x-1;<\/p>\n

\n\twhile\uff08\uff01S2\uff09;\/\/\u677e\u624b\u68c0\u6d4b<\/p>\n

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

\n\tif\uff08S3==0\uff09<\/p>\n

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

\n\tdelayms\uff0810\uff09;<\/p>\n

\n\tif\uff08S3==0\uff09y=y+5;<\/p>\n

\n\twhile\uff08\uff01S3\uff09;\/\/\u677e\u624b\u68c0\u6d4b<\/p>\n

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

\n\tif\uff08y\u300b254\uff09y=0;<\/p>\n

\n\tif\uff08m\u300b5\uff09m=0;<\/p>\n

\n\tif\uff08x\u300b50\uff09x=0;<\/p>\n

\n\tTR0=1;\/\/\u542f\u52a8\u5b9a\u65f6\u5668<\/p>\n

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

\n\tvoidfangbo\uff08\uff09\/\/\u65b9\u6ce2<\/p>\n

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

\n\tuchari\uff0cj;<\/p>\n

\n\tj=255-y;<\/p>\n

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

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

\n\tfor\uff08i=y;i\u300b0;i--\uff09<\/p>\n

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

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

\n\tdelay\uff08x\uff09;<\/p>\n

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

\n\twhile\uff08j--\uff09<\/p>\n

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

\n\tP0=255;<\/p>\n

\n\tdelay\uff08x\uff09;<\/p>\n

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

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

\n\tvoidjuchi\uff08\uff09\/\/\u952f\u9f7f\u6ce2<\/p>\n

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

\n\tuchari;<\/p>\n

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

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

\n\tfor\uff08i=255;i\u300b0;i--\uff09<\/p>\n

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

\n\tP0=i;<\/p>\n

\n\tdelay\uff08x\uff09;<\/p>\n

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

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

\n\tvoidsanjiao\uff08\uff09\/\/\u4e09\u89d2\u6ce2<\/p>\n

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

\n\tuchari;<\/p>\n

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

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

\n\tfor\uff08i=0;i\u300a255;i++\uff09<\/p>\n

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

\n\tP0=i;<\/p>\n

\n\tdelay\uff08x\uff09;<\/p>\n

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

\n\twhile\uff08i--\uff09<\/p>\n

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

\n\tP0=i;<\/p>\n

\n\tdelay\uff08x\uff09;<\/p>\n

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

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

\n\tvoidTIxing\uff08\uff09\/\/\u68af\u5f62\u6ce2<\/p>\n

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

\n\tuchari=255\uff0cj\uff0ck;<\/p>\n

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

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

\n\twhile\uff08i--\uff09<\/p>\n

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

\n\tP0=i;<\/p>\n

\n\tdelay\uff08x\uff09;<\/p>\n

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

\n\tfor\uff08j=0;j\u300a100;j++\uff09<\/p>\n

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

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

\n\tdelay\uff08x\uff09;<\/p>\n

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

\n\tfor\uff08k=0;k\u300a255;k++\uff09<\/p>\n

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

\n\tP0=k;<\/p>\n

\n\tdelay\uff08x\uff09;<\/p>\n

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

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

\n\tvoidsi<\/u>n\uff08\uff09\/\/\u6b63\u5f26\u6ce2<\/p>\n

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

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

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

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

\n\tfor\uff08a=0;a\u300a255;a++\uff09<\/p>\n

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

\n\tP0=SinTab\uff3ba\uff3d;<\/p>\n

\n\tdelay\uff08x\uff09;<\/p>\n

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

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

\n\tmai<\/u>n\uff08\uff09<\/p>\n

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

\n\tTIme0_init\uff08\uff09;<\/p>\n

\n\twhile\uff081\uff09<\/p>\n

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

\n\tswitch\uff08m\uff09<\/p>\n

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

\n\tcase0\uff1a<\/p>\n

\n\tfangbo\uff08\uff09;\/\/\u65b9\u6ce2<\/p>\n

\n\tbreak;<\/p>\n

\n\tcase1\uff1a<\/p>\n

\n\tjuchi\uff08\uff09;\/\/\u952f\u9f7f\u6ce2<\/p>\n

\n\tbreak;<\/p>\n

\n\tcase2\uff1a<\/p>\n

\n\tsanjiao\uff08\uff09;\/\/\u4e09\u89d2\u6ce2<\/p>\n

\n\tbreak;<\/p>\n

\n\tcase3\uff1a<\/p>\n

\n\tsin\uff08\uff09;\/\/\u6b63\u5f26\u6ce2<\/p>\n

\n\tbreak;<\/p>\n

\n\tcase4\uff1a<\/p>\n

\n\ttixing\uff08\uff09;\/\/\u68af\u5f62\u6ce2<\/p>\n

\n\tbreak;<\/p>\n

\n\tdefault:fangbo\uff08\uff09;<\/p>\n

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

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

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

\u7528 \u5355\u7247\u673a \u4ea7\u751f\u65b9\u6ce2\u3001\u952f\u9f7f\u6ce2\u3001\u4e09\u89d2\u6ce2\u3001\u68af\u5f62\u6ce2\uff0c\u9891\u7387\u53ef\u8c03 #include #defineucharunsignedchar #defineuintunsignedint unsignedcharx=0\uff0cm=0\uff0cy=128; sbitWR_DA=P2^1; sbitCS_DA=P2^0;\/\/DA\u4e0e \u5355\u7247\u673a \u7684\u63a5\u53e3 sbitS0=P3^0;\/\/\u6ce2<\/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\/2525"}],"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=2525"}],"version-history":[{"count":0,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/2525\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2525"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2525"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}