{"id":3207,"date":"2021-10-29T00:00:16","date_gmt":"2021-10-28T15:00:16","guid":{"rendered":"https:\/\/www.ekit-tech.com\/?p=3207"},"modified":"2024-01-26T12:18:52","modified_gmt":"2024-01-26T03:18:52","slug":"%e3%80%90%e9%80%9a%e9%81%8e%e3%82%bb%e3%83%b3%e3%82%b5%e3%80%91%e8%b5%a4%e5%a4%96%e7%b7%9aled%e3%81%a7%e7%89%a9%e4%bd%93%e3%81%ae%e9%80%9a%e8%a1%8c%e3%82%92%e6%a4%9c%e7%9f%a5%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/www.ekit-tech.com\/?p=3207","title":{"rendered":"\u3010\u901a\u904e\u30bb\u30f3\u30b5\u3011\u8d64\u5916\u7ddaLED\u3068\u30e9\u30baPico\u3067\u7269\u4f53\u306e\u901a\u884c\u3092\u691c\u77e5\u3059\u308b"},"content":{"rendered":"\n<p>\u8d64\u5916\u7ddaLED\u3092\u4f7f\u3063\u3066\u3001\u901a\u904e\u30bb\u30f3\u30b5\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p><figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper youtube\"><iframe src=\"https:\/\/www.youtube.com\/embed\/zV0V9Nc9TyY\"><\/iframe><\/div><\/figure><\/p>\n\n\n\n<p>LED\u304b\u3089\u306f\u3001\u5e38\u306b\u30c0\u30df\u30fc\u4fe1\u53f7\u3092\u9001\u308a\u7d9a\u3051\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>LED\u3068\u8d64\u5916\u7dda\u53d7\u4fe1\u30bb\u30f3\u30b5\u30fc\u306e\u9593\u3092\u7269\u4f53\u304c\u6a2a\u5207\u308b\u3068\u3001\u8d64\u5916\u7dda\u901a\u4fe1\u304c\u906e\u65ad\u3055\u308c\u3001\u305d\u306e\u77ac\u9593\u3092\u691c\u77e5\u3059\u308b\u4ed5\u7d44\u307f\u3067\u3059\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u7269\u4f53\u304c\u691c\u77e5\u3055\u308c\u308b\u3068\u3001LED\u304c\u6d88\u706f\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u691c\u77e5\u3057\u30661\u79d2\u7d4c\u3064\u3068\u3001\u307e\u305fLED\u304c\u70b9\u706f\u3057\u3001\u6b21\u306e\u691c\u77e5\u3092\u958b\u59cb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<\/div><h2>\u914d\u7dda\u30fb\u56de\u8def\u56f3<\/h2><div class=\"inner\">\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20211027-2.jpg\"><img loading=\"lazy\" width=\"1200\" height=\"800\" src=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20211027-2.jpg\" alt=\"\u901a\u904e\u30bb\u30f3\u30b5\u306e\u914d\u7dda\u30fb\u56de\u8def\u56f3\" class=\"wp-image-3209\" srcset=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20211027-2.jpg 1200w, https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20211027-2-300x200.jpg 300w, https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20211027-2-768x512.jpg 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20211027-4.jpg\"><img loading=\"lazy\" width=\"1200\" height=\"675\" src=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20211027-4-1200x675.jpg\" alt=\"\u8d64\u5916\u7ddaLED\u3068\u8d64\u5916\u7dda\u53d7\u4fe1\u30bb\u30f3\u30b5\u3092\u4f7f\u3063\u305f\u901a\u904e\u30bb\u30f3\u30b5\" class=\"wp-image-3221\" srcset=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20211027-4-1200x675.jpg 1200w, https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20211027-4-300x169.jpg 300w, https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20211027-4-768x432.jpg 768w, https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20211027-4.jpg 1280w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/a><\/figure>\n\n\n\n<\/div><h2>\u4f7f\u7528\u30d1\u30fc\u30c4<\/h2><div class=\"inner\">\n\n\n\n<ul><li><a href=\"https:\/\/akizukidenshi.com\/catalog\/g\/g103261\">5mm\u8d64\u5916\u7ddaLED\uff08OSI5FU5111C-40\uff09\uff0d \u79cb\u6708\u96fb\u5b50\u901a\u5546<\/a><\/li><li><a href=\"https:\/\/akizukidenshi.com\/catalog\/g\/g104659\">\u8d64\u5916\u7dda\u30ea\u30e2\u30b3\u30f3\u53d7\u4fe1\u30e2\u30b8\u30e5\u30fc\u30eb\uff08OSRB38C9AA\uff09\uff0d \u79cb\u6708\u96fb\u5b50\u901a\u5546<\/a><\/li><li>Raspberry Pi Pico<\/li><\/ul>\n\n\n\n<\/div><h2>\u30d7\u30ed\u30b0\u30e9\u30e0\uff08MicroPython\uff09<\/h2><div class=\"inner\">\n\n\n\n<pre class=\"wp-block-code\"><code># \u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u95a2\u9023\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u8aad\u307f\u8fbc\u307f\nfrom machine import Pin, ADC, PWM\n\n# \u6642\u9593\u95a2\u9023\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u8aad\u307f\u8fbc\u307f\nimport time\n\n# \u30b9\u30c6\u30fc\u30bf\u30b9\u78ba\u8a8d\u7528LED\n# \u30e9\u30ba\u30d1\u30a4Pico\u672c\u4f53\u306b\u642d\u8f09\u3055\u308c\u3066\u3044\u308bLED\u3092\u51fa\u529b\u30d4\u30f3\u306b\u8a2d\u5b9a\nled = Pin(25, Pin.OUT)\n\n# \u8d64\u5916\u7dda\u53d7\u4fe1\u30bb\u30f3\u30b5\u30fc\u306b\u63a5\u7d9a\u3059\u308b\u30d4\u30f3\n# \u30a2\u30ca\u30ed\u30b0\uff0d\u30c7\u30b8\u30bf\u30eb\u5909\u63db\u3092\u884c\u3046\u30d4\u30f3\u3092ADC0\uff0831Pin\uff09\u306b\u8a2d\u5b9a\nsens = ADC(0)\n\n# \u8d64\u5916\u7ddaLED\u3092\u63a5\u7d9a\u3059\u308b\u30d4\u30f3\n# PWM\u5236\u5fa1\u3092\u884c\u3046\u30d4\u30f3\u3092GP17\uff0822Pin\uff09\u306b\u8a2d\u5b9a\npwm = PWM(Pin(17, Pin.OUT))\n\n# PWM\u5236\u5fa1\u306e\u52d5\u4f5c\u5468\u6ce2\u6570\uff08\u4e00\u79d2\u9593\u306b\u7e70\u308a\u8fd4\u3059\u6ce2\u306e\u6570\uff09\u3092\u8a2d\u5b9a\n# \u5024\u3092\u5c0f\u3055\u304f\u3059\u308b\u3068\u611f\u5ea6\u304c\u4e0a\u304c\u308b\nf = 60000\npwm.freq(f)\n\n# \u6c38\u4e45\u30ea\u30d4\u30fc\u30c8\nwhile True:\n    \n    # PWM\u5236\u5fa1\u306b\u3066\u3001\u8d64\u5916\u7ddaLED\u304b\u3089\u30c0\u30df\u30fc\u4fe1\u53f7\u3092\u767a\u4fe1\n    # PWM\u306e\u30c7\u30e5\u30fc\u30c6\u30a3\u30fc\u6bd4\uff08HIGH\u3068LOW\u306e\u6bd4\u7387\uff09\u3092HIGH\uff1a1\/3\u3001LOW\uff1a2\/3\u306b\u8a2d\u5b9a\n    # 16bit\u306e\u6700\u5927\u5024 = FFFF\uff0816\u9032\u6570\uff09= 65535(10\u9032\u6570\uff09\n    # 65535 * 0.3333 = 21845(10\u9032\u6570\uff09= 5555\uff0816\u9032\u6570\uff09\n    pwm.duty_u16(0x5555)\n    \n    # \u8d64\u5916\u7ddaLED\u304b\u3089\u306e\u30c0\u30df\u30fc\u4fe1\u53f7\u3092\u53d7\u4fe1\u3057\u3066\u3001AD\u5909\u63db\n    # read_u16() \u30fb\u30fb\u30fb\u30a2\u30ca\u30ed\u30b0\u5024\u3092\u8aad\u8fbc\u307f\uff3b0-65535\uff3d\u306e\u6574\u6570\u3092\u8fd4\u3059\u95a2\u6570\n    # 16bit\u30fb2\u9032\u6570\u306e\u6700\u5927\u5024\uff1a1111111111111111 \u21d2 10\u9032\u6570\u306e\u6700\u5927\u5024\uff1a65535\n    # \u96fb\u5727\u306e\u6700\u5927\u50243.3V\u3092\u300c65535\u300d\u306b\u7f6e\u304d\u63db\u3048\n    adc = sens.read_u16() * (3.3 \/ 65535)\n\n    # \u8d64\u5916\u7dda\u53d7\u4fe1\u30bb\u30f3\u30b5\u30fc\u304c\u306e\u5024\u304c1.0V\u3088\u308a\u5c0f\u3055\u3044\u3068\u304d\u306b\u5b9f\u884c\n    # \uff08\u8d64\u5916\u7dda\u901a\u4fe1\u3092\u53d7\u4fe1\u3057\u3066\u3044\u308b\uff09\n    if adc &gt; 1.0:\n        \n        # \u30b9\u30c6\u30fc\u30bf\u30b9\u78ba\u8a8d\u7528LED\u3092\u70b9\u706f\n        led.value(1)\n\n    # \u8d64\u5916\u7dda\u53d7\u4fe1\u30bb\u30f3\u30b5\u30fc\u304c\u306e\u5024\u304c1.0V\u3088\u308a\u5927\u304d\u3044\u3068\u304d\u306b\u5b9f\u884c\n    # \uff08\u8d64\u5916\u7dda\u901a\u4fe1\u304c\u906e\u65ad\u3055\u308c\u3066\u3044\u308b\uff09\n    else:\n\n        # \u30b9\u30c6\u30fc\u30bf\u30b9\u78ba\u8a8d\u7528LED\u3092\u6d88\u706f\n        led.value(0)\n        \n        # \u8d64\u5916\u7dda\u901a\u4fe1\u3092\u533a\u5207\u308b\n        pwm.duty_u16(0)\n        \n        # \u6b21\u306e\u691c\u77e5\u3092\u306f\u3058\u3081\u308b\u307e\u3067\u306e\u5f85\u6a5f\u6642\u9593\n        time.sleep(1)<\/code><\/pre>\n\n\n\n<\/div><h2>\u6280\u8853\u89e3\u8aac<\/h2><div class=\"inner\">\n\n\n\n<p>\u3053\u306e\u901a\u904e\u30bb\u30f3\u30b5\u306f\u3001\u300c<a href=\"https:\/\/www.ekit-tech.com\/?p=2535\">\u8d64\u5916\u7dda\u30ea\u30e2\u30b3\u30f3\u306e\u9001\u53d7\u4fe1<\/a>\u300d\u306e\u6280\u8853\u3092\u5229\u7528\u3057\u305f\u3082\u306e\u3067\u3059\u3002<\/p>\n\n\n\n<h3>\u30e1\u30ea\u30c3\u30c8<\/h3>\n\n\n\n<ul><li>\u30d5\u30a9\u30c8\u30ea\u30d5\u30ec\u30af\u30bf\u3088\u308a\u3082\u9577\u3044\u8ddd\u96e2\u3092\u691c\u77e5\u3067\u304d\u308b<\/li><li><a href=\"https:\/\/www.ekit-tech.com\/?p=2165\">CDS<\/a>\u306e\u3088\u3046\u306b\u660e\u308b\u3055\u306e\u5f71\u97ff\u3092\u53d7\u3051\u306a\u3044\uff08\u7167\u660e\u3084\u4eba\u9593\u306e\u5f71\u306a\u3069\u3067\u8aa4\u691c\u77e5\u3057\u306a\u3044\uff09<\/li><\/ul>\n\n\n\n<h3>\u30c7\u30e1\u30ea\u30c3\u30c8<\/h3>\n\n\n\n<ul><li>\u4ed6\u306e\u30bb\u30f3\u30b5\u30fc\u306b\u6bd4\u3079\u3066\u3084\u3084\u9ad8\u4fa1<\/li><li>\u6d88\u8cbb\u96fb\u529b\u304c\u5927\u304d\u3044<\/li><\/ul>\n\n\n\n<\/div><h2 id=\"ex\">\u4f7f\u7528\u4f8b<\/h2><div class=\"inner\">\n\n\n\n<p><figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper youtube\"><iframe src=\"https:\/\/www.youtube.com\/embed\/sU0iuDZgH9E\"><\/iframe><\/div><\/figure><\/p>\n\n\n\n<p><a href=\"https:\/\/www.gachi-pla.com\/?p=638\">\u30df\u30c3\u30ad\u30fc\u304c\u558b\u308b\u30c8\u30f3\u30cd\u30eb\u3092\u4f5c\u3063\u3066\u307f\u305f \u2013 \u30ac\u30c1\u30d7\u30e9<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8d64\u5916\u7ddaLED\u3092\u4f7f\u3063\u3066\u3001\u901a\u904e\u30bb\u30f3\u30b5\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u305f\u3002 LED\u304b\u3089\u306f\u3001\u5e38\u306b\u30c0\u30df\u30fc\u4fe1\u53f7\u3092\u9001\u308a\u7d9a\u3051\u3066\u3044\u307e\u3059\u3002 LED\u3068\u8d64\u5916\u7dda\u53d7\u4fe1\u30bb\u30f3\u30b5\u30fc\u306e\u9593\u3092\u7269\u4f53\u304c\u6a2a\u5207\u308b\u3068\u3001\u8d64\u5916\u7dda\u901a\u4fe1\u304c\u906e\u65ad\u3055\u308c\u3001\u305d\u306e\u77ac\u9593\u3092\u691c\u77e5\u3059\u308b\u4ed5\u7d44\u307f\u3067\u3059\u3002 \u7269\u4f53\u304c\u691c\u77e5\u3055\u308c\u308b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3220,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[30],"tags":[44,72],"_links":{"self":[{"href":"https:\/\/www.ekit-tech.com\/index.php?rest_route=\/wp\/v2\/posts\/3207"}],"collection":[{"href":"https:\/\/www.ekit-tech.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ekit-tech.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ekit-tech.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ekit-tech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3207"}],"version-history":[{"count":24,"href":"https:\/\/www.ekit-tech.com\/index.php?rest_route=\/wp\/v2\/posts\/3207\/revisions"}],"predecessor-version":[{"id":7469,"href":"https:\/\/www.ekit-tech.com\/index.php?rest_route=\/wp\/v2\/posts\/3207\/revisions\/7469"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ekit-tech.com\/index.php?rest_route=\/wp\/v2\/media\/3220"}],"wp:attachment":[{"href":"https:\/\/www.ekit-tech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ekit-tech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ekit-tech.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}