{"id":2229,"date":"2021-08-24T20:16:43","date_gmt":"2021-08-24T11:16:43","guid":{"rendered":"https:\/\/www.ekit-tech.com\/?p=2229"},"modified":"2024-01-26T12:22:44","modified_gmt":"2024-01-26T03:22:44","slug":"%e3%80%90%e3%83%a9%e3%82%ba%e3%83%91%e3%82%a4pico%e3%80%91%e3%83%86%e3%83%bc%e3%83%96%e3%83%ab%e3%82%b5%e3%83%83%e3%82%ab%e3%83%bc%e3%81%ab%e3%80%8c%e3%82%b4%e3%82%a9%e3%82%a9%e3%83%bc%e3%83%bc","status":"publish","type":"post","link":"https:\/\/www.ekit-tech.com\/?p=2229","title":{"rendered":"\u3010\u30e9\u30ba\u30d1\u30a4Pico\u3011\u30c6\u30fc\u30d6\u30eb\u30b5\u30c3\u30ab\u30fc\u306b\u300c\u30b4\u30a9\u30a9\u30fc\u30fc\u30fc\u30eb\uff01\u300d\u306e\u97f3\u58f0\u3092\u4ed8\u3051\u3066\u307f\u305f"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210823-1.jpg\"><img loading=\"lazy\" width=\"1200\" height=\"800\" src=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210823-1.jpg\" alt=\"\u30b4\u30a9\u30a9\u30fc\u30fc\u30fc\u30eb\uff01\u300d\u306e\u97f3\u58f0\u3092\u4ed8\u3051\u308b\u305f\u3081\u306e\u30e9\u30ba\u30d1\u30a4Pico\u3092\u4f7f\u3063\u305f\u56de\u8def\" class=\"wp-image-2232\" srcset=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210823-1.jpg 1200w, https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210823-1-300x200.jpg 300w, https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210823-1-768x512.jpg 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/a><\/figure>\n\n\n\n<p>DFPlayer mini\u3068CDS\uff08\u5149\u30bb\u30f3\u30b5\uff09\u3092\u4f7f\u3063\u3066\u3001\u30c6\u30fc\u30d6\u30eb\u30b5\u30c3\u30ab\u30fc\u306b\u97f3\u58f0\u3092\u4ed8\u3051\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u30dc\u30fc\u30eb\u304c\u30b4\u30fc\u30eb\u306b\u5165\u308b\u3068\u3001\u300c\u30b4\u30a9\u30a9\u30fc\u30fc\u30fc\u30eb\uff01\u300d\u3068\u3044\u3046\u58f0\u304c\u9cf4\u308a\u307e\u3059\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\/0Cp7opVB824\"><\/iframe><\/div><\/figure><\/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\/f261ee76dd4af09a36d3c143ff2b9ba7.jpg\"><img loading=\"lazy\" width=\"1200\" height=\"800\" src=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/f261ee76dd4af09a36d3c143ff2b9ba7.jpg\" alt=\"DFPlayer mini\u3068CDS\uff08\u5149\u30bb\u30f3\u30b5\uff09\u3092\u4f7f\u3063\u3066\u3001\u30c6\u30fc\u30d6\u30eb\u30b5\u30c3\u30ab\u30fc\u306b\u97f3\u58f0\u3092\u4ed8\u3051\u308b\u305f\u3081\u306e\u914d\u7dda\u30fb\u56de\u8def\u56f3\" class=\"wp-image-2235\" srcset=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/f261ee76dd4af09a36d3c143ff2b9ba7.jpg 1200w, https:\/\/www.ekit-tech.com\/wp-content\/uploads\/f261ee76dd4af09a36d3c143ff2b9ba7-300x200.jpg 300w, https:\/\/www.ekit-tech.com\/wp-content\/uploads\/f261ee76dd4af09a36d3c143ff2b9ba7-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\/5363181e0dc2d7b3adaa4c1fc2eb46c5.jpg\"><img loading=\"lazy\" width=\"1200\" height=\"800\" src=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/5363181e0dc2d7b3adaa4c1fc2eb46c5.jpg\" alt=\"\u5168\u4f53\u306e\u914d\u7dda\u5199\u771f\" class=\"wp-image-2247\" srcset=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/5363181e0dc2d7b3adaa4c1fc2eb46c5.jpg 1200w, https:\/\/www.ekit-tech.com\/wp-content\/uploads\/5363181e0dc2d7b3adaa4c1fc2eb46c5-300x200.jpg 300w, https:\/\/www.ekit-tech.com\/wp-content\/uploads\/5363181e0dc2d7b3adaa4c1fc2eb46c5-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\/20210823-4.jpg\"><img loading=\"lazy\" width=\"1200\" height=\"800\" src=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210823-4.jpg\" alt=\"\u56de\u8def\u5199\u771f\" class=\"wp-image-2246\" srcset=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210823-4.jpg 1200w, https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210823-4-300x200.jpg 300w, https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210823-4-768x512.jpg 768w\" 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>Raspberry Pi Pico<\/li><li>Aideepen DFPlayer Mini\uff08<a href=\"https:\/\/www.amazon.co.jp\/gp\/product\/B07M93GZVJ\/ref=as_li_tl?ie=UTF8&amp;camp=247&amp;creative=1211&amp;creativeASIN=B07M93GZVJ&amp;linkCode=as2&amp;tag=kouryuudou-22&amp;linkId=dbb149ff71c59d95cca8039b037a2e1f\">Amazon<\/a>\uff09<\/li><li>CDS\uff08<a href=\"https:\/\/akizukidenshi.com\/catalog\/g\/g100110\">\u79cb\u6708\u96fb\u5b50<\/a>\uff09<\/li><li>\u30c0\u30a4\u30ca\u30df\u30c3\u30af\u30b9\u30d4\u30fc\u30ab\u30fc\uff08<a href=\"https:\/\/akizukidenshi.com\/catalog\/g\/g109013\">\u79cb\u6708\u96fb\u5b50<\/a>\uff09<\/li><li>\u30b9\u30e9\u30a4\u30c9\u30b9\u30a4\u30c3\u30c1\uff08<a href=\"https:\/\/akizukidenshi.com\/catalog\/g\/g112723\">\u79cb\u6708\u96fb\u5b50<\/a>\uff09<\/li><li>\u96fb\u6c60\u30dc\u30c3\u30af\u30b9\uff08<a href=\"https:\/\/akizukidenshi.com\/catalog\/g\/g103195\">\u79cb\u6708\u96fb\u5b50<\/a>\uff09<\/li><li>\u30e6\u30cb\u30d0\u30fc\u30b5\u30eb\u57fa\u677f<\/li><li>\u30b9\u30da\u30fc\u30b5\u30fc<\/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\nimport machine\n\n# \u6642\u9593\u95a2\u9023\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u8aad\u307f\u8fbc\u307f\nimport utime\n\n# UART\u521d\u671f\u8a2d\u5b9a\uff08UART\u756a\u53f7,\u30af\u30ed\u30c3\u30af\u30ec\u30fc\u30c8,TX\u30d4\u30f3\uff1aGP4\/6Pin,RX\u30d4\u30f3\uff1aGP5\/7Pin\uff09\nuart = machine.UART(1,baudrate=9600,tx = machine.Pin(4),rx = machine.Pin(5))\n\n# GP17\uff0822Pin\uff09\u3092\u51fa\u529b\u30d4\u30f3\u306b\u8a2d\u5b9a\u3001\u30d7\u30eb\u30c0\u30a6\u30f3\uff08\u521d\u671f\u5024\uff09\uff1a0\nled = machine.Pin(17, machine.Pin.OUT,machine.Pin.PULL_DOWN)\n\n# ADC0\uff0831Pin\uff09\u30fbADC1\uff0832Pin\uff09\u3092ADC\u5909\u63db\u30d4\u30f3\u306b\u8a2d\u5b9a\ncds1 = machine.ADC(0)\ncds2 = machine.ADC(1)\n\n# \u6c38\u4e45\u30ea\u30d4\u30fc\u30c8\nwhile True:\n    \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    # 3.3\/65535\u306e\u610f\u5473\uff1a\u96fb\u5727\u306e\u6700\u5927\u50243.3V\u3092\u300165535\u3068\u3044\u3046\u6570\u5024\u306b\u3042\u3066\u306f\u3081\u308b\u305f\u3081\u306e\u8a08\u7b97\n    adc1 = cds1.read_u16() * (3.3 \/ 65535)\n    adc2 = cds2.read_u16() * (3.3 \/ 65535)\n    \n    # 0.3V\u4ee5\u4e0b\u306e\u3068\u304d\u5b9f\u884c\n    if adc1 &lt; 0.3 or adc2 &lt; 0.3:\n        \n        # \u30b7\u30ea\u30a2\u30eb\u30c7\u30fc\u30bf\u306e\u4f5c\u6210\uff08\u4e00\u66f2\u3060\u3051\u3092\u518d\u751f\uff09\n        sdata = bytearray(&#91;0x7E,0xFF,0x06,0x03,0x00,0x00,0x02,0xEF])\n\n        # \u30b7\u30ea\u30a2\u30eb\u30c7\u30fc\u30bf\u306e\u9001\u4fe1\n        uart.write(sdata)\n        \n        # 6\u79d2wait\n        utime.sleep(6)<\/code><\/pre>\n\n\n\n<\/div><h2>\u6280\u8853\u89e3\u8aac<\/h2><div class=\"inner\">\n\n\n\n<p>\u5404\u30d1\u30fc\u30c4\u306e\u57fa\u672c\u89e3\u8aac\u306f\u3001\u904e\u53bb\u8a18\u4e8b\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<ul><li><a href=\"https:\/\/www.ekit-tech.com\/?p=2198\">UART\u901a\u4fe1\u3067DFPlayer\u3092\u5236\u5fa1\u3059\u308b<\/a><\/li><li><a href=\"https:\/\/www.ekit-tech.com\/?p=2165\">CDS\u5149\u30bb\u30f3\u30b5\u30fc\u3067AD\u5909\u63db\uff08\u30a2\u30ca\u30ed\u30b0\u2192\u30c7\u30b8\u30bf\u30eb\u5909\u63db\uff09<\/a><\/li><li><a href=\"https:\/\/www.ekit-tech.com\/?p=304\">Raspberry Pi Pico\u306e\u521d\u671f\u8a2d\u5b9a<\/a><\/li><\/ul>\n\n\n\n<p>\u5149\u30bb\u30f3\u30b5\u30fc\u306f\u76f4\u5217\uff12\u500b\u305a\u3064\u7e4b\u304e\u3001\u5408\u8a08\uff14\u500b\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u3002<\/p>\n\n\n\n<p>\u76f4\u5217\u306b\u7e4b\u3044\u3060\u5149\u30bb\u30f3\u30b5\u30fc\u306e\u3069\u3061\u3089\u304b\u306b\u30dc\u30fc\u30eb\u304c\u5f53\u305f\u308b\u3068\u3001\u96fb\u5727\u304c\u4e0b\u304c\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u308c\u304c\u97f3\u58f0\u3092\u767a\u3059\u308b\u30c8\u30ea\u30ac\u30fc\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210823-6.jpg\"><img loading=\"lazy\" width=\"1200\" height=\"800\" src=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210823-6.jpg\" alt=\"\u30c6\u30fc\u30d6\u30eb\u30b5\u30c3\u30ab\u30fc\u306b\u53d6\u308a\u4ed8\u3051\u305fCDS\uff08\u5149\u30bb\u30f3\u30bf\u30fc\uff09\" class=\"wp-image-2244\" srcset=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210823-6.jpg 1200w, https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210823-6-300x200.jpg 300w, https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210823-6-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\/20210823-5.jpg\"><img loading=\"lazy\" width=\"1200\" height=\"800\" src=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210823-5.jpg\" alt=\"CDS\uff08\u5149\u30bb\u30f3\u30b5\uff09\u306e\u88cf\u5074\u914d\u7dda\" class=\"wp-image-2245\" srcset=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210823-5.jpg 1200w, https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210823-5-300x200.jpg 300w, https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210823-5-768x512.jpg 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/a><\/figure>\n\n\n\n<\/div><h2>\u8ffd\u8a18<\/h2><div class=\"inner\">\n\n\n\n<p>\u7167\u660e\u306e\u660e\u308b\u3055\u3084\u30dc\u30fc\u30eb\u306e\u4f4d\u7f6e\u306b\u3088\u3063\u3066\u306f\u8aa4\u4f5c\u52d5\u3092\u8d77\u3053\u3059\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3082\u3063\u3068\u7cbe\u5ea6\u306e\u9ad8\u3044\u691c\u77e5\u3092\u884c\u3046\u306b\u306f\u3001\u8d64\u5916\u7ddaLED\u3092\u4f7f\u7528\u3057\u305f\u65b9\u6cd5\u304c\u30aa\u30b9\u30b9\u30e1\u3067\u3059\u2193<\/p>\n\n\n\n<p><a href=\"https:\/\/www.ekit-tech.com\/?p=3207\">\u3010\u901a\u904e\u30bb\u30f3\u30b5\u3011\u8d64\u5916\u7ddaLED\u3067\u7269\u4f53\u306e\u901a\u884c\u3092\u691c\u77e5\u3059\u308b<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>DFPlayer mini\u3068CDS\uff08\u5149\u30bb\u30f3\u30b5\uff09\u3092\u4f7f\u3063\u3066\u3001\u30c6\u30fc\u30d6\u30eb\u30b5\u30c3\u30ab\u30fc\u306b\u97f3\u58f0\u3092\u4ed8\u3051\u3066\u307f\u307e\u3057\u305f\u3002 \u30dc\u30fc\u30eb\u304c\u30b4\u30fc\u30eb\u306b\u5165\u308b\u3068\u3001\u300c\u30b4\u30a9\u30a9\u30fc\u30fc\u30fc\u30eb\uff01\u300d\u3068\u3044\u3046\u58f0\u304c\u9cf4\u308a\u307e\u3059\u3002 \u914d\u7dda\u30fb\u56de\u8def\u56f3 \u4f7f\u7528\u30d1\u30fc\u30c4 Raspberry Pi Pi [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2253,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[57],"tags":[44,50,51,72],"_links":{"self":[{"href":"https:\/\/www.ekit-tech.com\/index.php?rest_route=\/wp\/v2\/posts\/2229"}],"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=2229"}],"version-history":[{"count":21,"href":"https:\/\/www.ekit-tech.com\/index.php?rest_route=\/wp\/v2\/posts\/2229\/revisions"}],"predecessor-version":[{"id":7474,"href":"https:\/\/www.ekit-tech.com\/index.php?rest_route=\/wp\/v2\/posts\/2229\/revisions\/7474"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ekit-tech.com\/index.php?rest_route=\/wp\/v2\/media\/2253"}],"wp:attachment":[{"href":"https:\/\/www.ekit-tech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ekit-tech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ekit-tech.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}