
{"id":876,"date":"2016-05-05T18:02:49","date_gmt":"2016-05-05T10:02:49","guid":{"rendered":"https:\/\/www.webteach.tw\/?p=876"},"modified":"2016-05-05T18:02:49","modified_gmt":"2016-05-05T10:02:49","slug":"arduino-7%e6%ae%b5%e9%a1%af%e7%a4%ba%e5%85%83%e4%bb%b6-%e5%9b%9b%e4%bb%b6%e5%bc%8f%e6%a8%a1%e7%b5%84-9999-%e5%80%92%e6%95%b8%e5%8a%9f%e8%83%bd","status":"publish","type":"post","link":"https:\/\/www.webteach.tw\/?p=876","title":{"rendered":"[ Arduino ] \u2013 7\u6bb5\u986f\u793a\u5143\u4ef6  \u56db\u4ef6\u5f0f\u6a21\u7d44 9999 \u5012\u6578\u529f\u80fd"},"content":{"rendered":"<div style='text-align:center' class='yasr-auto-insert-overall'><\/div><div style='text-align:center' class='yasr-auto-insert-visitor'><\/div><div style=\"margin-top: 0px; margin-bottom: 0px;\" class=\"sharethis-inline-share-buttons\" ><\/div><p>\t\t\t\t[javascript]<br \/>\n \/\/\u5b9a\u7fa9\u986f\u793a\u6578\u5b57 0~9 \u5168\u4eae<br \/>\nconst int pinState[11][8] = {<br \/>\n  {1, 1, 1, 1, 1, 1, 0, 0}, \/\/ 0<br \/>\n  {0, 1, 1, 0, 0, 0, 0, 0}, \/\/ 1<br \/>\n  {1, 1, 0, 1, 1, 0, 1, 0}, \/\/ 2<br \/>\n  {1, 1, 1, 1, 0, 0, 1, 0}, \/\/ 3<br \/>\n  {0, 1, 1, 0, 0, 1, 1, 0}, \/\/ 4<br \/>\n  {1, 0, 1, 1, 0, 1, 1, 0}, \/\/ 5<br \/>\n  {1, 0, 1, 1, 1, 1, 1, 0}, \/\/ 6<br \/>\n  {1, 1, 1, 0, 0, 0, 0, 0}, \/\/ 7<br \/>\n  {1, 1, 1, 1, 1, 1, 1, 0}, \/\/ 8<br \/>\n  {1, 1, 1, 1, 0, 1, 1, 0}, \/\/ 9<br \/>\n  {1, 1, 1, 1, 1, 1, 1, 1}  \/\/ 10<br \/>\n \/\/a, b, c, d, e, f, g, h<br \/>\n};<br \/>\nvoid setup() {<br \/>\n   \/\/ put your setup code here, to run once:<br \/>\n    for(int i = 2; i &lt; 14; i++) {<br \/>\n        pinMode(i, OUTPUT);<br \/>\n    }<br \/>\n    set8(9, 13);<br \/>\n    set8(9, 12);<br \/>\n    set8(9, 11);<br \/>\n    set8(9, 10);<br \/>\n}<br \/>\nvoid loop() {<br \/>\n    for(int i=9999;i&gt;0;i&#8211;){<br \/>\n      int a=(i\/1000);<br \/>\n      int b=((i-(a*1000))\/100);<br \/>\n      int c=((i-(a*1000)-(b*100))\/10);<br \/>\n      int d=(i-(a*1000)-(b*100)-(c*10));<br \/>\n      set8(a, 13);<br \/>\n      set8(b, 12);<br \/>\n      set8(c, 11);<br \/>\n      set8(d, 10);<br \/>\n    }<br \/>\n    set8(0, 13);<br \/>\n    set8(0, 12);<br \/>\n    set8(0, 11);<br \/>\n    set8(0, 10);<br \/>\n}<br \/>\nvoid set8(int number, int pos) {<br \/>\n    for(int i = 10; i &lt; 14; i++) {<br \/>\n        digitalWrite(i, 1);<br \/>\n    }<br \/>\n    for(int i = 0;i &lt; 8;i++) {<br \/>\n        digitalWrite(i + 2, pinState[number][i]);<br \/>\n    }<br \/>\n    digitalWrite(pos, LOW);<br \/>\n    delay(1);<br \/>\n}<br \/>\n[\/javascript]\t\t<\/p>\n<div style='text-align:center' class='yasr-auto-insert-overall'><\/div><div style='text-align:center' class='yasr-auto-insert-visitor'><\/div>","protected":false},"excerpt":{"rendered":"<p>[javascript] \/\/\u5b9a\u7fa9\u986f\u793a\u6578 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"yasr_overall_rating":0,"yasr_post_is_review":"","yasr_auto_insert_disabled":"","yasr_review_type":"","footnotes":""},"categories":[19],"tags":[93,360,667],"class_list":["post-876","post","type-post","status-publish","format-standard","hentry","category-arduino","tag-93","tag-led","tag-667"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>[ Arduino ] \u2013 7\u6bb5\u986f\u793a\u5143\u4ef6 \u56db\u4ef6\u5f0f\u6a21\u7d44 9999 \u5012\u6578\u529f\u80fd - \u6df7\u6c34\u6478\u9b5a<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webteach.tw\/?p=876\" \/>\n<meta property=\"og:locale\" content=\"zh_TW\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[ Arduino ] \u2013 7\u6bb5\u986f\u793a\u5143\u4ef6 \u56db\u4ef6\u5f0f\u6a21\u7d44 9999 \u5012\u6578\u529f\u80fd - \u6df7\u6c34\u6478\u9b5a\" \/>\n<meta property=\"og:description\" content=\"[javascript] \/\/\u5b9a\u7fa9\u986f\u793a\u6578 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webteach.tw\/?p=876\" \/>\n<meta property=\"og:site_name\" content=\"\u6df7\u6c34\u6478\u9b5a\" \/>\n<meta property=\"article:published_time\" content=\"2016-05-05T10:02:49+00:00\" \/>\n<meta name=\"author\" content=\"jeff\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005:\" \/>\n\t<meta name=\"twitter:data1\" content=\"jeff\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9810\u4f30\u95b1\u8b80\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\u9418\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=876#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=876\"},\"author\":{\"name\":\"jeff\",\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/#\\\/schema\\\/person\\\/d434d754fd581338113eecfa923d7520\"},\"headline\":\"[ Arduino ] \u2013 7\u6bb5\u986f\u793a\u5143\u4ef6 \u56db\u4ef6\u5f0f\u6a21\u7d44 9999 \u5012\u6578\u529f\u80fd\",\"datePublished\":\"2016-05-05T10:02:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=876\"},\"wordCount\":107,\"commentCount\":0,\"keywords\":[\"7\u6bb5\",\"LED\",\"\u5012\u6578\"],\"articleSection\":[\"Arduino\"],\"inLanguage\":\"zh-TW\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.webteach.tw\\\/?p=876#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=876\",\"url\":\"https:\\\/\\\/www.webteach.tw\\\/?p=876\",\"name\":\"[ Arduino ] \u2013 7\u6bb5\u986f\u793a\u5143\u4ef6 \u56db\u4ef6\u5f0f\u6a21\u7d44 9999 \u5012\u6578\u529f\u80fd - \u6df7\u6c34\u6478\u9b5a\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/#website\"},\"datePublished\":\"2016-05-05T10:02:49+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/#\\\/schema\\\/person\\\/d434d754fd581338113eecfa923d7520\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=876#breadcrumb\"},\"inLanguage\":\"zh-TW\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.webteach.tw\\\/?p=876\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=876#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9801\",\"item\":\"https:\\\/\\\/www.webteach.tw\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[ Arduino ] \u2013 7\u6bb5\u986f\u793a\u5143\u4ef6 \u56db\u4ef6\u5f0f\u6a21\u7d44 9999 \u5012\u6578\u529f\u80fd\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/#website\",\"url\":\"https:\\\/\\\/www.webteach.tw\\\/\",\"name\":\"\u6df7\u6c34\u6478\u9b5a\",\"description\":\"\u5b78\u7121\u6b62\u5883,\u6559\u5b78\u76f8\u9577\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.webteach.tw\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-TW\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/#\\\/schema\\\/person\\\/d434d754fd581338113eecfa923d7520\",\"name\":\"jeff\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-TW\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5797200e421b670a2ce64d6e7382054c69b231d4aab55742c96bb1e51bc9fefc?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5797200e421b670a2ce64d6e7382054c69b231d4aab55742c96bb1e51bc9fefc?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5797200e421b670a2ce64d6e7382054c69b231d4aab55742c96bb1e51bc9fefc?s=96&d=mm&r=g\",\"caption\":\"jeff\"},\"sameAs\":[\"http:\\\/\\\/35.72.55.111\"],\"url\":\"https:\\\/\\\/www.webteach.tw\\\/?author=1\"},false]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[ Arduino ] \u2013 7\u6bb5\u986f\u793a\u5143\u4ef6 \u56db\u4ef6\u5f0f\u6a21\u7d44 9999 \u5012\u6578\u529f\u80fd - \u6df7\u6c34\u6478\u9b5a","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webteach.tw\/?p=876","og_locale":"zh_TW","og_type":"article","og_title":"[ Arduino ] \u2013 7\u6bb5\u986f\u793a\u5143\u4ef6 \u56db\u4ef6\u5f0f\u6a21\u7d44 9999 \u5012\u6578\u529f\u80fd - \u6df7\u6c34\u6478\u9b5a","og_description":"[javascript] \/\/\u5b9a\u7fa9\u986f\u793a\u6578 [&hellip;]","og_url":"https:\/\/www.webteach.tw\/?p=876","og_site_name":"\u6df7\u6c34\u6478\u9b5a","article_published_time":"2016-05-05T10:02:49+00:00","author":"jeff","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005:":"jeff","\u9810\u4f30\u95b1\u8b80\u6642\u9593":"1 \u5206\u9418"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webteach.tw\/?p=876#article","isPartOf":{"@id":"https:\/\/www.webteach.tw\/?p=876"},"author":{"name":"jeff","@id":"https:\/\/www.webteach.tw\/#\/schema\/person\/d434d754fd581338113eecfa923d7520"},"headline":"[ Arduino ] \u2013 7\u6bb5\u986f\u793a\u5143\u4ef6 \u56db\u4ef6\u5f0f\u6a21\u7d44 9999 \u5012\u6578\u529f\u80fd","datePublished":"2016-05-05T10:02:49+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webteach.tw\/?p=876"},"wordCount":107,"commentCount":0,"keywords":["7\u6bb5","LED","\u5012\u6578"],"articleSection":["Arduino"],"inLanguage":"zh-TW","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webteach.tw\/?p=876#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webteach.tw\/?p=876","url":"https:\/\/www.webteach.tw\/?p=876","name":"[ Arduino ] \u2013 7\u6bb5\u986f\u793a\u5143\u4ef6 \u56db\u4ef6\u5f0f\u6a21\u7d44 9999 \u5012\u6578\u529f\u80fd - \u6df7\u6c34\u6478\u9b5a","isPartOf":{"@id":"https:\/\/www.webteach.tw\/#website"},"datePublished":"2016-05-05T10:02:49+00:00","author":{"@id":"https:\/\/www.webteach.tw\/#\/schema\/person\/d434d754fd581338113eecfa923d7520"},"breadcrumb":{"@id":"https:\/\/www.webteach.tw\/?p=876#breadcrumb"},"inLanguage":"zh-TW","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webteach.tw\/?p=876"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.webteach.tw\/?p=876#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9801","item":"https:\/\/www.webteach.tw\/"},{"@type":"ListItem","position":2,"name":"[ Arduino ] \u2013 7\u6bb5\u986f\u793a\u5143\u4ef6 \u56db\u4ef6\u5f0f\u6a21\u7d44 9999 \u5012\u6578\u529f\u80fd"}]},{"@type":"WebSite","@id":"https:\/\/www.webteach.tw\/#website","url":"https:\/\/www.webteach.tw\/","name":"\u6df7\u6c34\u6478\u9b5a","description":"\u5b78\u7121\u6b62\u5883,\u6559\u5b78\u76f8\u9577","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webteach.tw\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-TW"},{"@type":"Person","@id":"https:\/\/www.webteach.tw\/#\/schema\/person\/d434d754fd581338113eecfa923d7520","name":"jeff","image":{"@type":"ImageObject","inLanguage":"zh-TW","@id":"https:\/\/secure.gravatar.com\/avatar\/5797200e421b670a2ce64d6e7382054c69b231d4aab55742c96bb1e51bc9fefc?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5797200e421b670a2ce64d6e7382054c69b231d4aab55742c96bb1e51bc9fefc?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5797200e421b670a2ce64d6e7382054c69b231d4aab55742c96bb1e51bc9fefc?s=96&d=mm&r=g","caption":"jeff"},"sameAs":["http:\/\/35.72.55.111"],"url":"https:\/\/www.webteach.tw\/?author=1"},false]}},"views":603,"yasr_visitor_votes":{"stars_attributes":{"read_only":false,"span_bottom":false},"number_of_votes":0,"sum_votes":0},"_links":{"self":[{"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/posts\/876","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=876"}],"version-history":[{"count":0,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/posts\/876\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=876"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=876"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=876"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}