{"id":45,"date":"2025-07-16T01:33:29","date_gmt":"2025-07-15T17:33:29","guid":{"rendered":"https:\/\/newknow.top\/?p=45"},"modified":"2025-07-20T07:54:49","modified_gmt":"2025-07-19T23:54:49","slug":"%e7%8b%ac%e7%ab%8b%e6%8c%89%e9%94%ae%e6%8e%a7%e5%88%b6led%e6%98%be%e7%a4%ba%e4%ba%8c%e8%bf%9b%e5%88%b6","status":"publish","type":"post","link":"https:\/\/newknow.top\/index.php\/2025\/07\/16\/%e7%8b%ac%e7%ab%8b%e6%8c%89%e9%94%ae%e6%8e%a7%e5%88%b6led%e6%98%be%e7%a4%ba%e4%ba%8c%e8%bf%9b%e5%88%b6\/","title":{"rendered":"51\u5355\u7247\u673a\u2014\u2014\u72ec\u7acb\u6309\u952e\u63a7\u5236LED\u663e\u793a\u4e8c\u8fdb\u5236"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>#include &lt;REGX52.H>\nvoid Delay(unsigned int xms)\n{\n\tunsigned char i, j;\n\twhile(xms)\n\t{\n\n\t\ti = 2;\n\t\tj = 239;\n\t\tdo\n  \t\t{\n\t\t\twhile (--j);\n\t\t} while (--i);\n\t\txms--;\n\t}\n}\nvoid main()\n{\n\tunsigned char lednum=0;\n\twhile(1)\n\t{\n\t\tif(P3_1==0)\n\t\t{\n\t\t\tDelay(20);\n\t\t\twhile(P3_1==0);\n\t\t\tDelay(20);\n\t\t\tlednum++;\n\t\t\tP2=~lednum;\n\t\t}\n\t}\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e3a\u4ec0\u4e48\u8981\u5b9a\u4e49lednum\uff1f<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u56e0\u4e3a\u5982\u679c<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>P2++;\nP2=~P2;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">P2\u6700\u5f00\u59cb\u4e3a1111 1111 \u52a0\u5230\u6700\u540e\u4e3a0000 0000<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u518d\u8fdb\u884c\u6309\u4f4d\u53d6\u53cd\u7684\u8bdd\u53c8\u53d8\u56de1111 1111<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e3a\u4ec0\u4e48\u8981\u5b9a\u4e49lednum\uff1f \u56e0\u4e3a\u5982\u679c P2\u6700\u5f00\u59cb\u4e3a1111 1111 \u52a0\u5230\u6700\u540e\u4e3a0000 0000 \u518d\u8fdb\u884c\u6309\u4f4d [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kadence_starter_templates_imported_post":false,"footnotes":""},"categories":[5,4],"tags":[],"class_list":["post-45","post","type-post","status-publish","format-standard","hentry","category-5","category-4"],"_links":{"self":[{"href":"https:\/\/newknow.top\/index.php\/wp-json\/wp\/v2\/posts\/45","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/newknow.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/newknow.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/newknow.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/newknow.top\/index.php\/wp-json\/wp\/v2\/comments?post=45"}],"version-history":[{"count":3,"href":"https:\/\/newknow.top\/index.php\/wp-json\/wp\/v2\/posts\/45\/revisions"}],"predecessor-version":[{"id":64,"href":"https:\/\/newknow.top\/index.php\/wp-json\/wp\/v2\/posts\/45\/revisions\/64"}],"wp:attachment":[{"href":"https:\/\/newknow.top\/index.php\/wp-json\/wp\/v2\/media?parent=45"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/newknow.top\/index.php\/wp-json\/wp\/v2\/categories?post=45"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/newknow.top\/index.php\/wp-json\/wp\/v2\/tags?post=45"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}