{"id":505,"date":"2021-02-27T12:11:42","date_gmt":"2021-02-27T03:11:42","guid":{"rendered":"https:\/\/www.ekit-tech.com\/?p=505"},"modified":"2021-12-06T22:24:41","modified_gmt":"2021-12-06T13:24:41","slug":"%e3%80%90%e3%83%a9%e3%82%ba%e3%83%91%e3%82%a4zero%e3%80%91%e3%83%9c%e3%82%bf%e3%83%b3%e3%82%92%e6%8a%bc%e3%81%99%e3%81%a8%e5%90%88%e6%88%90%e9%9f%b3%e5%a3%b0%e3%81%a7%e4%bb%8a%e3%81%ae%e6%99%82","status":"publish","type":"post","link":"https:\/\/www.ekit-tech.com\/?p=505","title":{"rendered":"\u3010\u30e9\u30ba\u30d1\u30a4ZERO\u3011\u30dc\u30bf\u30f3\u3092\u62bc\u3059\u3068\u5408\u6210\u97f3\u58f0\u3067\u4eca\u306e\u6642\u9593\u3092\u558b\u308b\u30b9\u30d4\u30fc\u30ab\u30fc"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210227-03.jpg\"><img loading=\"lazy\" width=\"1200\" height=\"800\" src=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210227-03.jpg\" alt=\"\u3010\u30e9\u30ba\u30d1\u30a4ZERO\u3011\u30dc\u30bf\u30f3\u3092\u62bc\u3059\u3068\u5408\u6210\u97f3\u58f0\u3067\u4eca\u306e\u6642\u9593\u3092\u558b\u308b\u30b9\u30d4\u30fc\u30ab\u30fc\" class=\"wp-image-506\" srcset=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210227-03.jpg 1200w, https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210227-03-300x200.jpg 300w, https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210227-03-768x512.jpg 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/a><\/figure>\n\n\n\n<p>\u30e9\u30ba\u30d1\u30a4ZERO\u3092\u4f7f\u3063\u3066\u3001\u30dc\u30bf\u30f3\u3092\u62bc\u3059\u3068\u4eca\u306e\u6642\u9593\u3092\u558b\u308b\u88c5\u7f6e\u3092\u4f5c\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<\/div><h2>\u52d5\u753b<\/h2><div class=\"inner\">\n\n\n\n<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\">\n<iframe loading=\"lazy\" title=\"\u3010\u30e9\u30ba\u30d1\u30a4ZERO\u3011\u30dc\u30bf\u30f3\u3092\u62bc\u3059\u3068\u5408\u6210\u97f3\u58f0\u3067\u4eca\u306e\u6642\u9593\u3092\u558b\u308b\u30b9\u30d4\u30fc\u30ab\u30fc\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/GHG8BO1-vFY?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<\/div><h2>\u914d\u7dda\u56f3\u30fb\u5fc5\u8981\u306a\u3082\u306e<\/h2><div class=\"inner\">\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210227-04.jpg\"><img loading=\"lazy\" width=\"1200\" height=\"800\" src=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210227-04.jpg\" alt=\"\u30e9\u30ba\u30d1\u30a4ZERO\u3067\u5408\u6210\u97f3\u58f0\u3092\u30b9\u30d4\u30fc\u30ab\u30fc\u3067\u518d\u751f\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306a\u3082\u306e\" class=\"wp-image-522\" srcset=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210227-04.jpg 1200w, https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210227-04-300x200.jpg 300w, https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210227-04-768x512.jpg 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210227-02.jpg\"><img loading=\"lazy\" width=\"1200\" height=\"800\" src=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210227-02.jpg\" alt=\"\u30e9\u30ba\u30d1\u30a4ZERO\u3068\u30b9\u30a4\u30c3\u30c1\u306e\u914d\u7dda\u56f3\" class=\"wp-image-511\" srcset=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210227-02.jpg 1200w, https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210227-02-300x200.jpg 300w, https:\/\/www.ekit-tech.com\/wp-content\/uploads\/20210227-02-768x512.jpg 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/a><figcaption>\u30e9\u30ba\u30d1\u30a4ZERO\u3068\u30b9\u30a4\u30c3\u30c1\u306e\u914d\u7dda\u56f3<\/figcaption><\/figure>\n\n\n\n<ol><li><a href=\"https:\/\/www.amazon.co.jp\/gp\/product\/B07J2P6J83\/ref=as_li_tl?ie=UTF8&amp;camp=247&amp;creative=1211&amp;creativeASIN=B07J2P6J83&amp;linkCode=as2&amp;tag=kouryuudou-22&amp;linkId=0e5ccf46aa7e344c99daf053e46ec25c\">\u30bb\u30eb\u30d5\u30d1\u30ef\u30fc\u578bUSB\u30cf\u30d6<\/a><\/li><li><a href=\"https:\/\/www.amazon.co.jp\/gp\/product\/B07G2ZZ3FY\/ref=as_li_tl?ie=UTF8&amp;camp=247&amp;creative=1211&amp;creativeASIN=B07G2ZZ3FY&amp;linkCode=as2&amp;tag=kouryuudou-22&amp;linkId=52f78e2adf4357eb2651e9b415e17201\">USB \u21d4 3.5 mm\u30b8\u30e3\u30c3\u30af\u5909\u63db\u30a2\u30c0\u30d7\u30bf<\/a><\/li><li>\u30c0\u30a4\u30bd\u30fc\u306e300\u5186\u30b9\u30d4\u30fc\u30ab\u30fc<a href=\"https:\/\/www.ekit-tech.com\/?p=548\">\uff08\u6539\u9020\uff09<\/a><\/li><li><a href=\"#dv1\">\u30de\u30a4\u30af\u30edUSB\uff08\u30aa\u30b9\uff09 \u21d4 USB Type-A\uff08\u30e1\u30b9\uff09\u5909\u63db\u30b3\u30cd\u30af\u30bf<\/a><\/li><li><a href=\"https:\/\/www.amazon.co.jp\/gp\/product\/B0711PVX6Z\/ref=as_li_tl?ie=UTF8&amp;camp=247&amp;creative=1211&amp;creativeASIN=B0711PVX6Z&amp;linkCode=as2&amp;tag=kouryuudou-22&amp;linkId=3dfac6e87cef9df0490a41428a09c13c\">\u30de\u30a4\u30af\u30edUSB\uff08\u30aa\u30b9\uff09 \u21d4 USB Type-A\uff08\u30aa\u30b9\uff09\u5909\u63db\u30b1\u30fc\u30d6\u30eb<\/a><\/li><li>\u30d7\u30eb\u30c0\u30a6\u30f3\u7528\u62b5\u6297\uff0810k\u03a9\uff09<\/li><li>\u30b9\u30bf\u30fc\u30c8\u7528\u30b9\u30a4\u30c3\u30c1<\/li><li>\u30c0\u30a4\u30bd\u30fc\u3067\u8cb7\u3063\u305f\u571f\u53f0<\/li><\/ol>\n\n\n\n<\/div><h2>\u30d7\u30ed\u30b0\u30e9\u30e0\uff08voice_sw.py\uff09<\/h2><div class=\"inner\">\n\n\n\n<pre class=\"wp-block-code\"><code># coding: UTF-8\n\nimport subprocess,datetime,time\nimport RPi.GPIO as GPIO\n\n# \u30d4\u30f3\u306e\u6307\u5b9a\u65b9\u6cd5\nGPIO.setmode(GPIO.BCM)\n\n# GPIO25\nGPIO.setup(25, GPIO.IN)\n\n# \u30dc\u30bf\u30f3\u30af\u30ea\u30c3\u30af\u5f85\u6a5f\u4e2d\nprint(\"\u30dc\u30bf\u30f3\u5f85\u6a5f\u4e2d...\")\n\nwhile (True):\n\n        # \u5272\u308a\u8fbc\u307f\u51e6\u7406\uff08\u30dc\u30bf\u30f3\u3092\u62bc\u3059\uff06\u7acb\u3061\u4e0a\u304c\u308a\u3092\u691c\u77e5\uff09\n        GPIO.wait_for_edge(25, GPIO.RISING)\n\n        # \u30dc\u30bf\u30f3\u306e\u9577\u62bc\u3057\u3092\u691c\u77e5\u3059\u308b\u305f\u3081\u306e\u30ab\u30a6\u30f3\u30bf\u30fc\n        cnt = 0;\n\n        while (True):\n\n                if GPIO.input(25) == GPIO.LOW:\n\n                        print(\"\u30dc\u30bf\u30f3\u304c\u62bc\u3055\u308c\u307e\u3057\u305f\")\n\n                        # \u5408\u6210\u97f3\u58f0\u3092\u518d\u751f\u3059\u308b\u305f\u3081\u306e\u95a2\u6570\n                        def voice_play(voice_path):\n                                subprocess.call(\"sudo aplay \" + voice_path, shell=True)\n\n                        # \u65e5\u6642\u306e\u53d6\u5f97\n                        dt_now = datetime.datetime.now()\n                        hour = dt_now.hour\n                        min = dt_now.minute\n                        print(str(hour) + \"\u6642\" + str(min) + \"\u5206\")\n\n                        # \u30b3\u30e1\u30f3\u30c8\u306e\u518d\u751f\n                        voice_file = \".\/voice\/kazumakun.wav\"\n                        voice_play(voice_file)\n\n                        # \u4eca\u306e\u6642\u9593\u306f\n                        voice_file = \".\/voice\/now.wav\"\n                        voice_play(voice_file)\n\n                        # \u6642\u9593\u30dc\u30a4\u30b9\u306e\u518d\u751f\n                        voice_file = \".\/voice\/hour_\" + str(hour) + \".wav\"\n                        voice_play(voice_file)\n\n\n                        # \u5206\u30dc\u30a4\u30b9\u306e\u518d\u751f\n                        voice_file = \".\/voice\/min_\" + str(min) + \".wav\"\n                        voice_play(voice_file)\n\n                        # \u3067\u3059\n                        voice_file = \".\/voice\/desu.wav\"\n                        voice_play(voice_file)\n\n                        # \u304a\u3084\u3064\u306e\u3058\u304b\u3093\n                        if (hour == 15 and min <= 30):\n                                voice_file = \".\/voice\/oyatu_yes.wav\"\n                        else:\n                                voice_file = \".\/voice\/oyatu_no.wav\"\n                        voice_play(voice_file)\n\n                        # \u3088\u308b\u3054\u306f\u3093\n                        if (hour == 18 and min <= 59):\n                                voice_file = \".\/voice\/dinner.wav\"\n                                voice_play(voice_file)\n\n                        # \u306d\u3093\u306d\n                        if (hour == 21 or  hour == 20):\n                                voice_file = \".\/voice\/nenne.wav\"\n                                voice_play(voice_file)\n\n                        break\n\n                else:\n                        cnt = cnt + 1\n\n                        if (cnt >= 250):\n                                print(\"\u9577\u62bc\u3057\u691c\u77e5\uff1a\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\")\n                                subprocess.call(\"sudo shutdown -h now\", shell=True)\n                                break\n\n                time.sleep(0.01)<\/code><\/pre>\n\n\n\n<p><a href=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/voice_sw.txt\">\u6700\u7d42\u7248\u30d7\u30ed\u30b0\u30e9\u30e0\uff1avoice_sw.txt<\/a><\/p>\n\n\n\n<p class=\"sp2\">\u6700\u521d\u306b\u66f8\u3044\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\uff08<a href=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/voice_beta.txt\">voice_beta.txt<\/a>\uff09\u3067\u306f\u3001\u30dc\u30bf\u30f3\u304c\u62bc\u3055\u308c\u308b\u305f\u3073\u306b\u6bce\u56de\u3001\u97f3\u58f0\u5408\u6210\u306e\u30c7\u30fc\u30bf\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u3068\u3053\u308d\u304c\u3001\u97f3\u58f0\u30c7\u30fc\u30bf\u306e\u4f5c\u6210\u306b3\u79d2\u307b\u3069\u306e\u6642\u9593\u304c\u639b\u304b\u3063\u3066\u3057\u307e\u3044\u3001\u30dc\u30bf\u30f3\u304c\u62bc\u3055\u308c\u3066\u304b\u3089\u58f0\u304c\u51fa\u308b\u307e\u3067\u306b\u30e9\u30b0\u304c\u767a\u751f\u3057\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u305d\u3053\u3067\u6700\u7d42\u7248\u3067\u306f\u30010\u6642\uff5e12\u6642\u30011\u5206\uff5e59\u5206\u307e\u3067\u306e\u97f3\u58f0\u30c7\u30fc\u30bf\u3092\u3042\u3089\u304b\u3058\u3081\u7528\u610f\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/www.ekit-tech.com\/wp-content\/uploads\/voice_make.txt\">\u97f3\u58f0\u4f5c\u6210\u30d7\u30ed\u30b0\u30e9\u30e0\uff1avoice_make.txt<\/a><\/p>\n\n\n\n<\/div><h2>OpenJtalk\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2><div class=\"inner\">\n\n\n\n<p>\u5408\u6210\u97f3\u58f0\u306b\u300cOpenJtalk\u300d\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3042\u3089\u304b\u3058\u3081\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p class=\"sp2\">\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3082\u53c2\u8003\u306b\u3069\u3046\u305e\u2193<\/p>\n\n\n\n<p><a href=\"https:\/\/www.ekit-tech.com\/?p=666\">\u5408\u6210\u97f3\u58f0\u300cOpen JTalk\u300d\u3067\u30cf\u30de\u3063\u305f\u3053\u3068<\/a><\/p>\n\n\n\n<\/div><h2>cron\u306e\u8a2d\u5b9a<\/h2><div class=\"inner\">\n\n\n\n<p>\u30e9\u30ba\u30d1\u30a4ZERO\u306e\u96fb\u6e90\u3092\u5165\u308c\u305f\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u3001\u81ea\u52d5\u7684\u306b\u300cvoice_sw.py\u300d\u3092\u8d77\u52d5\u3055\u305b\u308b\u305f\u3081\u306bcron\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u2193<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>crontab -e<\/code><\/pre>\n\n\n\n<p>\u300c@reboot python \/home\/pi\/test.py\u300d\u3092\u8ffd\u8a18\u3057\u3066\u3001\u4fdd\u5b58\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Notice that tasks will be started based on the cron's system\n# daemon's notion of time and timezones.\n#\n# Output of the crontab jobs (including errors) is sent through\n# email to the user the crontab file belongs to (unless redirected).\n#\n# For example, you can run a backup of all your user accounts\n# at 5 a.m every week with:\n# 0 5 * * 1 tar -zcf \/var\/backups\/home.tgz \/home\/\n#\n# For more information see the manual pages of crontab(5) and cron(8)\n#\n# m h  dom mon dow   command\n\n@reboot python \/home\/pi\/voice_sw.py\n<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30e9\u30ba\u30d1\u30a4ZERO\u3092\u4f7f\u3063\u3066\u3001\u30dc\u30bf\u30f3\u3092\u62bc\u3059\u3068\u4eca\u306e\u6642\u9593\u3092\u558b\u308b\u88c5\u7f6e\u3092\u4f5c\u308a\u307e\u3057\u305f\u3002 \u52d5\u753b \u914d\u7dda\u56f3\u30fb\u5fc5\u8981\u306a\u3082\u306e \u30bb\u30eb\u30d5\u30d1\u30ef\u30fc\u578bUSB\u30cf\u30d6 USB \u21d4 3.5 mm\u30b8\u30e3\u30c3\u30af\u5909\u63db\u30a2\u30c0\u30d7\u30bf \u30c0\u30a4\u30bd\u30fc\u306e300\u5186\u30b9\u30d4\u30fc\u30ab\u30fc\uff08\u6539\u9020\uff09 \u30de\u30a4\u30af\u30edU [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":543,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10],"tags":[43,51,55],"_links":{"self":[{"href":"https:\/\/www.ekit-tech.com\/index.php?rest_route=\/wp\/v2\/posts\/505"}],"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=505"}],"version-history":[{"count":28,"href":"https:\/\/www.ekit-tech.com\/index.php?rest_route=\/wp\/v2\/posts\/505\/revisions"}],"predecessor-version":[{"id":822,"href":"https:\/\/www.ekit-tech.com\/index.php?rest_route=\/wp\/v2\/posts\/505\/revisions\/822"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ekit-tech.com\/index.php?rest_route=\/wp\/v2\/media\/543"}],"wp:attachment":[{"href":"https:\/\/www.ekit-tech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=505"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ekit-tech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=505"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ekit-tech.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=505"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}