{"id":799,"date":"2016-03-01T11:30:55","date_gmt":"2016-03-01T03:30:55","guid":{"rendered":"https:\/\/www.webteach.tw\/?p=799"},"modified":"2016-03-01T11:30:55","modified_gmt":"2016-03-01T03:30:55","slug":"led","status":"publish","type":"post","link":"https:\/\/www.webteach.tw\/?p=799","title":{"rendered":"[ Arduino ] &#8211; Hello LED"},"content":{"rendered":"<p>\t\t\t\t\u958b\u555fblink\u7bc4\u4f8b\u7a0b\u5f0f<br \/>\n<a href=\"https:\/\/www.webteach.tw\/wp-content\/uploads\/2016\/03\/blink.jpg\" rel=\"attachment wp-att-801\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.webteach.tw\/wp-content\/uploads\/2016\/03\/blink.jpg\" alt=\"blink\" width=\"858\" height=\"749\" class=\"alignleft size-full wp-image-801\" srcset=\"https:\/\/www.webteach.tw\/wp-content\/uploads\/2016\/03\/blink.jpg 858w, https:\/\/www.webteach.tw\/wp-content\/uploads\/2016\/03\/blink-300x262.jpg 300w, https:\/\/www.webteach.tw\/wp-content\/uploads\/2016\/03\/blink-768x670.jpg 768w\" sizes=\"auto, (max-width: 858px) 100vw, 858px\" \/><\/a><br \/>\n\u7de8\u8b6f\u7a0b\u5f0f\u4e2d<br \/>\n<a href=\"https:\/\/www.webteach.tw\/wp-content\/uploads\/2016\/03\/verfily.png\" rel=\"attachment wp-att-804\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.webteach.tw\/wp-content\/uploads\/2016\/03\/verfily.png\" alt=\"verfily\" width=\"873\" height=\"759\" class=\"alignleft size-large wp-image-804\" srcset=\"https:\/\/www.webteach.tw\/wp-content\/uploads\/2016\/03\/verfily.png 873w, https:\/\/www.webteach.tw\/wp-content\/uploads\/2016\/03\/verfily-300x261.png 300w, https:\/\/www.webteach.tw\/wp-content\/uploads\/2016\/03\/verfily-768x668.png 768w\" sizes=\"auto, (max-width: 873px) 100vw, 873px\" \/><\/a><br \/>\n<a href=\"https:\/\/www.webteach.tw\/wp-content\/uploads\/2016\/03\/compiling.png\" rel=\"attachment wp-att-802\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.webteach.tw\/wp-content\/uploads\/2016\/03\/compiling.png\" alt=\"compiling\" width=\"873\" height=\"759\" class=\"alignleft size-large wp-image-802\" srcset=\"https:\/\/www.webteach.tw\/wp-content\/uploads\/2016\/03\/compiling.png 873w, https:\/\/www.webteach.tw\/wp-content\/uploads\/2016\/03\/compiling-300x261.png 300w, https:\/\/www.webteach.tw\/wp-content\/uploads\/2016\/03\/compiling-768x668.png 768w\" sizes=\"auto, (max-width: 873px) 100vw, 873px\" \/><\/a><br \/>\n\u5c07\u7a0b\u5f0f\u4e0a\u50b3\u5230\u677f\u5b50<br \/>\n<a href=\"https:\/\/www.webteach.tw\/wp-content\/uploads\/2016\/03\/upload.png\" rel=\"attachment wp-att-803\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.webteach.tw\/wp-content\/uploads\/2016\/03\/upload.png\" alt=\"upload\" width=\"873\" height=\"759\" class=\"alignleft size-large wp-image-803\" srcset=\"https:\/\/www.webteach.tw\/wp-content\/uploads\/2016\/03\/upload.png 873w, https:\/\/www.webteach.tw\/wp-content\/uploads\/2016\/03\/upload-300x261.png 300w, https:\/\/www.webteach.tw\/wp-content\/uploads\/2016\/03\/upload-768x668.png 768w\" sizes=\"auto, (max-width: 873px) 100vw, 873px\" \/><\/a><br \/>\n\u7a0b\u5f0f\u78bc\u7684\u90e8\u4efd<br \/>\n[java]<br \/>\n Blink<br \/>\n  Turns on an LED on for one second, then off for one second, repeatedly.<br \/>\n  Most Arduinos have an on-board LED you can control. On the Uno and<br \/>\n  Leonardo, it is attached to digital pin 13. If you&#8217;re unsure what<br \/>\n  pin the on-board LED is connected to on your Arduino model, check<br \/>\n  the documentation at http:\/\/www.arduino.cc<br \/>\n  This example code is in the public domain.<br \/>\n  modified 8 May 2014<br \/>\n  by Scott Fitzgerald<br \/>\n *\/<br \/>\n\/\/ the setup function runs once when you press reset or power the board<br \/>\nvoid setup() {<br \/>\n  \/\/ initialize digital pin 13 as an output.<br \/>\n  pinMode(13, OUTPUT);<br \/>\n}<br \/>\n\/\/ the loop function runs over and over again forever<br \/>\nvoid loop() {<br \/>\n  digitalWrite(13, HIGH);   \/\/ turn the LED on (HIGH is the voltage level)<br \/>\n  delay(1000);              \/\/ wait for a second \u8a66\u8457\u6539\u8b8a delay()\u4e2d\u7684\u6578\u5b57<br \/>\n  digitalWrite(13, LOW);    \/\/ turn the LED off by making the voltage LOW<br \/>\n  delay(1000);              \/\/ wait for a second \u8a66\u8457\u6539\u8b8a delay()\u4e2d\u7684\u6578\u5b57<br \/>\n}<br \/>\n[\/java]<br \/>\n\u57f7\u884c\u5f71\u7247(\u5167\u5efaLED)<br \/>\n<iframe loading=\"lazy\" width=\"420\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/1fbylj0KOxo\" frameborder=\"0\" allowfullscreen><\/iframe><br \/>\nLED \u6b63\u6975\u8ca0\u6975\u8aaa\u660e\u5716<br \/>\n\u9577\u7684\u70ba \u6b63\u6975 (LED\u5167\u90e8 \u6bd4\u8f03\u5c0f\u584a\u7684\u70ba\u6b63\u6975)<br \/>\n\u77ed\u7684\u70ba \u8ca0\u6975 (LED\u5167\u90e8 \u6bd4\u8f03\u5927\u584a\u7684\u70ba\u8ca0\u6975)<br \/>\n\u7531\u65bc\u6709\u6642\u6703\u5c07LED\u7684\u8173\u4f4d\u505a\u5f4e\u66f2\u7684\u52d5\u4f5c \u9019\u6642\u8acb\u770bLED\u7684\u5167\u90e8\u5340\u584a\u505a \u6b63\u8ca0\u6975\u7684\u5224\u65b7<br \/>\n<br \/>\n<a href=\"https:\/\/www.webteach.tw\/wp-content\/uploads\/2016\/03\/led.png\" rel=\"attachment wp-att-808\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.webteach.tw\/wp-content\/uploads\/2016\/03\/led-570x1024.png\" alt=\"led\" width=\"570\" height=\"1024\"  \/><\/a><br \/>\n<br \/>\n\u8a66\u8457\u5c07 LED \u7684\u9577\u8173\u4f4d(\u6b63\u6975) \u63d2\u5165\u7248\u672c\u4e2d 13 \u7684\u5b54\u4f4d\uff0c LED \u7684\u77ed\u8173\u4f4d(\u8ca0\u6975) \u63d2\u5165 GND(\u63a5\u5730\u7dda)\u4e2d\uff0c\u5982\u4e0b\u5716\u3002\u7b2c\u4e00\u500b\u5916\u63a5LED\u5c31\u6210\u529f\u4e86\u3002<br \/>\n<a href=\"https:\/\/www.webteach.tw\/wp-content\/uploads\/2016\/03\/IMG_20160301_092236-scaled-1.jpg\" rel=\"attachment wp-att-807\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.webteach.tw\/wp-content\/uploads\/2016\/03\/IMG_20160301_092236-1024x576.jpg\" alt=\"IMG_20160301_092236\" width=\"1024\" height=\"576\"  \/><\/a><br \/>\n\u57f7\u884c\u5f71\u7247(\u5916\u63a5LED)<br \/>\n<iframe loading=\"lazy\" width=\"420\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/UtWnbzByPRs\" frameborder=\"0\" allowfullscreen><\/iframe><br \/>\n<a href=\"https:\/\/shopee.tw\/5mm-LED-%E5%9C%93%E9%A0%AD-%E7%99%BD%E5%85%89-(10%E5%80%8B%E5%85%A5)-i.9111748.680207513\" rel=\"noopener noreferrer\" target=\"_blank\">\u6211\u8981\u8cb7 5mm LED<\/a><br \/>\n<a href=\"https:\/\/shopee.tw\/-%E6%B7%B7%E6%B0%B4%E6%91%B8%E9%AD%9A-5mm-Led-%E5%B0%88%E7%94%A8%E7%87%88%E5%BA%A7-%E5%90%AB-%E9%87%91%E5%B1%AC%E8%9E%BA%E5%B8%BD-%E5%BD%88%E7%B0%A7%E5%A2%8A%E7%89%87-LED%E5%9B%BA%E5%AE%9A%E7%94%A8%E7%99%BD%E8%89%B2%E5%A1%91%E8%86%A0%E5%A5%97-i.9111748.277089607\" rel=\"noopener noreferrer\" target=\"_blank\">\u6211\u8981\u8cb7 5mm LED \u56fa\u5b9a\u5ea7 <\/a>\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u958b\u555fblink\u7bc4\u4f8b\u7a0b\u5f0f \u7de8\u8b6f\u7a0b\u5f0f\u4e2d \u5c07\u7a0b\u5f0f\u4e0a\u50b3\u5230\u677f&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[120,296,360],"class_list":["post-799","post","type-post","status-publish","format-standard","hentry","category-arduino","tag-arduino","tag-hello","tag-led"],"_links":{"self":[{"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/posts\/799","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=799"}],"version-history":[{"count":0,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/posts\/799\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=799"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=799"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=799"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}