{"id":1709,"date":"2020-04-12T15:01:28","date_gmt":"2020-04-12T06:01:28","guid":{"rendered":"https:\/\/esoro.jp\/?p=1709"},"modified":"2020-04-29T11:04:54","modified_gmt":"2020-04-29T02:04:54","slug":"%e3%83%a9%e3%82%ba%e3%83%91%e3%82%a4%ef%bc%94%e3%81%a7keyestudio%e3%82%b9%e3%82%bf%e3%83%bc%e3%82%bf%e3%83%bc%e3%82%ad%e3%83%83%e3%83%88%e3%82%92%e8%a9%a6%e3%81%97%e3%81%a6%e3%81%bf%e3%81%9f%e3%80%82","status":"publish","type":"post","link":"https:\/\/esoro.jp\/?p=1709","title":{"rendered":"\u30e9\u30ba\u30d1\u30a4\uff14\u3067KEYESTUDIO\u30b9\u30bf\u30fc\u30bf\u30fc\u30ad\u30c3\u30c8\u3092\u8a66\u3057\u3066\u307f\u305f\u3002"},"content":{"rendered":"<p>\u3000\u81ea\u52d5\u6c34\u3084\u308a\u3092\u76ee\u6307\u3057\u3066\u8cfc\u5165\u3057\u305f<a href=\"http:\/\/esoro.jp\/?p=1698\">RaspberryPi4<\/a>\u3067\u3059\u304c\u3001\u4eca\u56de\u306e\u76ee\u7684\u306b\u4f7f\u3048\u305d\u3046\u306a\u4e0b\u8a18\u306e\u30ad\u30c3\u30c8\u3092\u8cfc\u5165\u3057\u307e\u3057\u305f\u3002<br \/>\n[blogcard url=&#8221;https:\/\/www.amazon.co.jp\/dp\/B0798DYZQW&#8221;]<br \/>\n \u4f7f\u3046\u4e88\u5b9a\u306a\u306e\u306f\u3001\u30b5\u30fc\u30dc\u3068\u6e29\u5ea6\u30fb\u6e7f\u5ea6\u3001\u571f\u58cc\u6e7f\u5ea6\u30bb\u30f3\u30b5\u30fc\u3067\u3057\u3087\u3046\u304b\u3002\u30e9\u30ba\u30d1\u30a4\u3082\u96fb\u5b50\u5de5\u4f5c\u3082\u7d20\u4eba\u306a\u306e\u3067\u3001\u307e\u305a\u306f\u5404\u30d1\u30fc\u30c4\u3092\u8a66\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/esoro.jp\/?attachment_id=1726\" rel=\"attachment wp-att-1726\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/esoro.jp\/wordpress\/wp-content\/uploads\/2020\/04\/keystudio-300x169.jpg\" alt=\"\" width=\"300\" height=\"169\" class=\"aligncenter size-medium wp-image-1726\" srcset=\"https:\/\/esoro.jp\/wordpress\/wp-content\/uploads\/2020\/04\/keystudio-300x169.jpg 300w, https:\/\/esoro.jp\/wordpress\/wp-content\/uploads\/2020\/04\/keystudio-500x281.jpg 500w, https:\/\/esoro.jp\/wordpress\/wp-content\/uploads\/2020\/04\/keystudio.jpg 551w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n\u3000LABISTS Raspberry4\u306e\u30b1\u30fc\u30b9\u306b\u306f\u5408\u308f\u306a\u3044\u3067\u3059\u304c\u3001\u3068\u308a\u3042\u3048\u305a\u3001GPIO-PCF8591 Shield\u3092\u53d6\u308a\u4ed8\u3051\u3066\u3001\u4f7f\u7528\u3059\u308b\u30d1\u30fc\u30c4\u3092\u6307\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u3000\u6700\u521d\u306b\u3001\u30b5\u30fc\u30dc\u3092\u8a66\u3057\u3066\u307f\u307e\u3059\u3002<a href=\"https:\/\/wiki.keyestudio.com\/KS0221_keyestudio_Ultimate_Starter_Kit_for_Raspberry_Pi#Lesson_19:_9g_Servo_Control\">KEYSTUDIO<\/a>\u306e\u30b5\u30a4\u30c8\u3067\u3059\u304c\u3001C\u8a00\u8a9e\u3067\u3059\u306d\u3002\u3002\u304a\u4e45\u3057\u3076\u308a\u3067\u3059\u3002python\u3067\u3084\u308a\u305f\u3044\u3068\u3053\u308d\u3067\u3059\u304c\u3001\u307e\u305a\u306f\u52d5\u4f5c\u78ba\u8a8d\u3067\u30ad\u30c3\u30c8\u306e\u30b5\u30a4\u30c8\u306b\u3042\u308b\u30b3\u30fc\u30c9\u3092\u305d\u306e\u307e\u307e\u3084\u3063\u3066\u307f\u307e\u3059\u3002\u4e0b\u8a18\u306fMakefile\u3067\u3059\u3002<\/p>\n<p><code><br \/>\nServo:Servo.o<br \/>\n\tgcc Servo.c -o Servo -lwiringPi<br \/>\n<\/code><br \/>\n\u3000Makefile\u306e\u30bf\u30d6\u304c\u66f2\u8005\u3067\u3059\u306d\u3002<\/p>\n<p><code><br \/>\npi@raspberrypi:~\/lesson\/19 $ ls<br \/>\nMakefile  Servo.c<br \/>\npi@raspberrypi:~\/lesson\/19 $ make<br \/>\ncc    -c -o Servo.o Servo.c<br \/>\ngcc Servo.c -o Servo -lwiringPi<br \/>\npi@raspberrypi:~\/lesson\/19 $ ls<br \/>\nMakefile  Servo  Servo.c  Servo.o<br \/>\n<\/code><\/p>\n<p>\u3000\u30b3\u30f3\u30d1\u30a4\u30eb\u51fa\u6765\u305f\u3088\u3046\u3067\u3059\u3002<\/p>\n<p><code><br \/>\npi@raspberrypi:~\/lesson\/19 $ sudo .\/Servo<br \/>\n<\/code><\/p>\n<p>\u3000\u3001\u3001\u3001\u3046\u3093\u3068\u3082\u3059\u3093\u3068\u3082\u52d5\u304d\u307e\u305b\u3093\u306d\u3002\u3002\u3002<\/p>\n<p><code><br \/>\npi@raspberrypi:~\/lesson\/19 $ gpio readall<br \/>\nOops - unable to determine board type... model: 17<br \/>\n<\/code><\/p>\n<p>\u3000gpio\u304c\u4f7f\u3048\u3066\u3044\u306a\u3044\u3088\u3046\u3067\u3059\u3002\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u304c\u3001<\/p>\n<p><code><br \/>\npi@raspberrypi:~\/lesson\/19 $ dpkg -l wiringpi<br \/>\n\u8981\u671b=(U)\u4e0d\u660e\/(I)\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\/(R)\u524a\u9664\/(P)\u5b8c\u5168\u524a\u9664\/(H)\u4fdd\u6301<br \/>\n| \u72b6\u614b=(N)\u7121\/(I)\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\/(C)\u8a2d\u5b9a\/(U)\u5c55\u958b\/(F)\u8a2d\u5b9a\u5931\u6557\/(H)\u534a\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\/(W)<br \/>\n|\/ \u30a8\u30e9\u30fc?=(\u7a7a\u6b04)\u7121\/(R)\u8981\u518d\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb (\u72b6\u614b,\u30a8\u30e9\u30fc\u306e\u5927\u6587\u5b57=\u7570\u5e38)<br \/>\n||\/ \u540d\u524d           \u30d0\u30fc\u30b8\u30e7\u30f3   \u30a2\u30fc\u30ad\u30c6\u30af\u30c1 \u8aac\u660e<br \/>\n+++-==============-============-============-===================================<br \/>\nii  wiringpi       2.50         armhf        The wiringPi libraries, headers and<br \/>\n<\/code><\/p>\n<p>\u3000\u3069\u3046\u3084\u3089\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u5bfe\u5fdc\u3057\u3066\u3044\u306a\u3044\u3088\u3046\u3067\u3059\u3002<a href=\"https:\/\/qiita.com\/naoppy\/items\/49ea700f87b525d6a481\">\u30b3\u30c1\u30e9<\/a>\u3092\u53c2\u8003\u306b\u3055\u305b\u3066\u9802\u304d\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><code><br \/>\npi@raspberrypi:~\/lesson\/19 $ gpio readall<br \/>\n +-----+-----+---------+------+---+---Pi 4B--+---+------+---------+-----+-----+<br \/>\n | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |<br \/>\n +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+<br \/>\n |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |<br \/>\n |   2 |   8 |   SDA.1 |   IN | 1 |  3 || 4  |   |      | 5v      |     |     |<br \/>\n |   3 |   9 |   SCL.1 |   IN | 1 |  5 || 6  |   |      | 0v      |     |     |<br \/>\n |   4 |   7 | GPIO. 7 |   IN | 1 |  7 || 8  | 1 | IN   | TxD     | 15  | 14  |<br \/>\n |     |     |      0v |      |   |  9 || 10 | 1 | IN   | RxD     | 16  | 15  |<br \/>\n |  17 |   0 | GPIO. 0 |   IN | 0 | 11 || 12 | 0 | IN   | GPIO. 1 | 1   | 18  |<br \/>\n |  27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |<br \/>\n |  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |<br \/>\n |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |<br \/>\n |  10 |  12 |    MOSI |   IN | 0 | 19 || 20 |   |      | 0v      |     |     |<br \/>\n |   9 |  13 |    MISO |   IN | 0 | 21 || 22 | 0 | IN   | GPIO. 6 | 6   | 25  |<br \/>\n |  11 |  14 |    SCLK |   IN | 0 | 23 || 24 | 1 | IN   | CE0     | 10  | 8   |<br \/>\n |     |     |      0v |      |   | 25 || 26 | 1 | IN   | CE1     | 11  | 7   |<br \/>\n |   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |<br \/>\n |   5 |  21 | GPIO.21 |   IN | 1 | 29 || 30 |   |      | 0v      |     |     |<br \/>\n |   6 |  22 | GPIO.22 |   IN | 1 | 31 || 32 | 0 | IN   | GPIO.26 | 26  | 12  |<br \/>\n |  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |<br \/>\n |  19 |  24 | GPIO.24 |   IN | 0 | 35 || 36 | 0 | IN   | GPIO.27 | 27  | 16  |<br \/>\n |  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO.28 | 28  | 20  |<br \/>\n |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO.29 | 29  | 21  |<br \/>\n +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+<br \/>\n | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |<br \/>\n +-----+-----+---------+------+---+---Pi 4B--+---+------+---------+-----+-----+<br \/>\n<\/code><\/p>\n<p>\u3000C\u306e\u30b5\u30f3\u30d7\u30eb\u304c\u52d5\u304f\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u3000C\u306e\u30b3\u30fc\u30c9\u3092\u305d\u306e\u307e\u307e\u3001python\u306b\u66f8\u304d\u63db\u3048\u307e\u3059\u3002<\/p>\n<pre class=\"lang:python decode:true \" title=\"Servo.py\" >import time\r\nimport wiringpi as w\r\n\r\n#Define\r\nINPUT=0\r\nOUTPUT=1\r\nHIGH=1\r\nLOW=0\r\n\r\nw.wiringPiSetup()\r\nw.pinMode(1,OUTPUT)\r\n\r\nwhile 1:\r\n  for i in range(50):\r\n    w.digitalWrite(1,HIGH)\r\n    time.sleep(1000 \/ 1000000.)\r\n    w.digitalWrite(1,LOW)\r\n    time.sleep(19 \/ 1000.)\r\n\r\n  time.sleep(1)\r\n\r\n  for i in range(50):\r\n    w.digitalWrite(1,HIGH)\r\n    time.sleep(2000 \/ 1000000.)\r\n    w.digitalWrite(1,LOW)\r\n    time.sleep(18 \/ 1000.)\r\n\r\n  time.sleep(1)<\/pre>\n<p><code><br \/>\npi@raspberrypi:~ $ sudo python3 Servo.py<br \/>\nTraceback (most recent call last):<br \/>\n  File \"Servo.py\", line 2, in <module><br \/>\n    import wiringpi as w<br \/>\nModuleNotFoundError: No module named 'wiringpi'<br \/>\n<\/code><\/p>\n<p>\u3000\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u8db3\u308a\u3066\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u3002<\/p>\n<p><code><br \/>\npi@raspberrypi:~ $ pip3 install wiringpi<br \/>\nLooking in indexes: https:\/\/pypi.org\/simple, https:\/\/www.piwheels.org\/simple<br \/>\nCollecting wiringpi<br \/>\n  Downloading https:\/\/files.pythonhosted.org\/packages\/06\/bf\/7c4ec17172f72917707dddeacfa02eae80b56ad3b7b5674a4258e62b2f5a\/wiringpi-2.60.0-cp37-cp37m-linux_armv7l.whl (285kB)<br \/>\n    100% |????????????????????????????????| 286kB 495kB\/s<br \/>\nInstalling collected packages: wiringpi<br \/>\nSuccessfully installed wiringpi-2.60.0<br \/>\n<\/code><\/p>\n<p>\u3000\u5b9f\u884c\u3057\u3066\u307f\u307e\u3059<br \/>\n<code><br \/>\npi@raspberrypi:~ $ python3 Servo.py<br \/>\n<\/code><\/p>\n<p>\u3000\u304a\u3001\u30ab\u30c1\u30e3\u30ab\u30c1\u30e3\u3068\u52d5\u304d\u3060\u3057\u307e\u3057\u305f\u3002\u7d30\u304b\u3044\u5236\u5fa1\u306f\u96e3\u3057\u305d\u3046\u306a\u306e\u3067\u5f8c\u56de\u3057\u306b\u3001\u3001<\/p>\n<p>\u3000\u6b21\u306f\u6e29\u5ea6\u30fb\u6e7f\u5ea6\u30bb\u30f3\u30b5\u30fc\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3000\u81ea\u52d5\u6c34\u3084\u308a\u3092\u76ee\u6307\u3057\u3066\u8cfc\u5165\u3057\u305fRaspberryPi4\u3067\u3059\u304c\u3001\u4eca\u56de\u306e\u76ee\u7684\u306b\u4f7f\u3048\u305d &hellip; <a href=\"https:\/\/esoro.jp\/?p=1709\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,7],"tags":[],"_links":{"self":[{"href":"https:\/\/esoro.jp\/index.php?rest_route=\/wp\/v2\/posts\/1709"}],"collection":[{"href":"https:\/\/esoro.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/esoro.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/esoro.jp\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/esoro.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1709"}],"version-history":[{"count":0,"href":"https:\/\/esoro.jp\/index.php?rest_route=\/wp\/v2\/posts\/1709\/revisions"}],"wp:attachment":[{"href":"https:\/\/esoro.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1709"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/esoro.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1709"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/esoro.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1709"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}