{"id":940,"date":"2018-01-05T14:32:22","date_gmt":"2018-01-05T05:32:22","guid":{"rendered":"https:\/\/www.kdel.org\/wp\/?p=940"},"modified":"2018-01-06T00:23:08","modified_gmt":"2018-01-05T15:23:08","slug":"raspbery-pi-on-fedora-23%e3%81%a7i2c%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%81%bf%e3%82%8b%ef%bc%88%e4%bd%bf%e3%81%a3%e3%81%a6%e3%81%bf%e3%81%9f%e3%81%84%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.kdel.org\/wp\/?p=940","title":{"rendered":"Raspbery pi on Fedora 23\u3067I2C\u3092\u4f7f\u3063\u3066\u30b8\u30e3\u30a4\u30ed\u306e\u5024\u53d6\u5f97\uff0e"},"content":{"rendered":"<p>Raspberry PI \u3067I2C \u901a\u4fe1\u3059\u308b\u65b9\u6cd5\u3092\u6a21\u7d22\u4e2d\uff0e<\/p>\n<p>Raspbian \u3067\u3042\u308c\u3070\uff0craspi-config \u304b\u3089\u7c21\u5358\u306b\u6709\u52b9\u5316\u3067\u304d\u308b\u306e\u3067\u3059\u304c\uff0c<br \/>\nFawkes \u306e\u95a2\u4fc2\u3067\uff0cFedora 23\u304c\u52d5\u3044\u3066\u3044\u308b\u3046\u3061\u306e\u7814\u7a76\u5ba4\u306eRaspberry Pi\uff0e<br \/>\n\u3055\u3066\uff0c\u3069\u3046\u3057\u307e\u3057\u3087\u3046\uff0e<\/p>\n<p>\u307e\u305a\uff0cRaspbian \u3067\u306e\u8aac\u660e\u306f<a href=\"https:\/\/tool-lab.com\/2013\/12\/raspi-gpio-controlling-command-2\/\">Raspberry Pi\u306eGPIO\u5236\u5fa1\u65b9\u6cd5\u3092\u78ba\u8a8d\u3059\u308b(GPIO\u5236\u5fa1\u7de8\u305d\u306e2)<\/a>\u3042\u305f\u308a\u304c\u8a73\u3057\u3044\uff0e<\/p>\n<p>Raspbian \u3060\u3068\uff0clibi2c-dev \u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u5165\u308c\u308c\u3070\u826f\u3044\u306e\u3060\u3051\u3069\uff0cFedora \u3060\u3068\uff0c<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">sudo dnf search i2c<\/pre>\n<p>\u3068\u3084\u3063\u3066\u3082\uff0ci2c-tools \u3057\u304b\u51fa\u3066\u3053\u306a\u3044\u2026\uff0e<\/p>\n<p>WireingPi\u306e\u30da\u30fc\u30b8\u3092\u898b\u3066\u3082[url=http:\/\/wiringpi.com\/reference\/i2c-library\/]I2C Library[\/code]\u3068\u3057\u3066\uff0c<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">gpio load i2c<\/pre>\n<p>\u304c\u66f8\u304b\u308c\u3066\u3044\u308b\u3051\u3069\uff0c\u8a66\u3057\u3066\u307f\u3066\u3082\uff0craspi-config \u3067i2c\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u8aad\u307f\u8fbc\u3081\u3068\u3057\u304b\u51fa\u3066\u3053\u306a\u3044\u2026\uff0e<\/p>\n<p>\u3046\u30fc\u3093\u3046\u30fc\u3093\u3068\u601d\u3063\u3066\u3044\u305f\u3089\uff0c\u4f3c\u305f\u3088\u3046\u306a\u3053\u3068\u3092\u3057\u3066\u3044\u308b\u4eba \u767a\u898b(*\uff9f\u0414\uff9f)\uff0e<br \/>\n<a href=\"https:\/\/beer.dip.jp\/wiki\/index.php\/Raspberry_Pi\/Fedora\/RTC%E5%B0%8E%E5%85%A5(DS1307)\">Raspberry Pi\/Fedora\/RTC\u5c0e\u5165(DS1307)<\/a><\/p>\n<p>\u3053\u3061\u3089\u3092\u53c2\u8003\u306b\uff0c\/boot\/config.txt \u306b dfparam=i2c_arm=on \u3092\u8ffd\u52a0\u3057\u305f\u3068\u3053\u308d\uff0c\/dev\/i2c-1 \u304c\u7121\u4e8b\u73fe\u308c\u307e\u3057\u305f\uff0e<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">&#x5B;pi@pi-01] $ sudo i2cdetect -y 1\r\n     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f\r\n00:          -- -- -- -- -- -- -- -- -- -- -- -- -- \r\n10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- \r\n20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- \r\n30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- \r\n40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- \r\n50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- \r\n60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- \r\n70: -- -- -- -- -- -- -- --   \r\n<\/pre>\n<p>\u3067\uff0camazon\u3067\u8cb7\u3063\u305f\u5b89\u7269\u30b8\u30e3\u30a4\u30ed<a href=\"https:\/\/www.amazon.co.jp\/gp\/product\/B00K67X810\">SODIAL(R) GY-521 MPU-60503\u8ef8\u30b8\u30e3\u30a4\u30ed+3\u8ef8\u52a0\u901f\u5ea6\u30bb\u30f3\u30b5<\/a>\u3092\u63a5\u7d9a\uff0e<br \/>\n\u914d\u7dda\u306f\uff0c<a href=\"http:\/\/devrel.qiniucdn.com\/data\/20160530225829\/index.html\">Raspberry Pi 3 Model B\u306e GPIO\u306b I2C\u901a\u4fe1\u65b9\u5f0f\u306e\u30b8\u30e3\u30a4\u30ed\uff0b\u52a0\u901f\u5ea6\u306e\uff16\u8ef8\u30bb\u30f3\u30b5\u30fc MPU-6050\u3092\u63a5\u7d9a\u3059\u308b\u65b9\u6cd5<\/a>\u304c\u308f\u304b\u308a\u3084\u3059\u3044\u3067\u3059\u304c\uff0c<br \/>\n\u79c1\u306f<a href=\"http:\/\/www.smartsustainability.org\/CIS508\/?page_id=1585\">Lab 4.2: Raspberry Pi &#8211; working with GPIO<\/a>\u3068\u57fa\u677f\u306e\u6587\u5b57\u3092\u53c2\u8003\u306b\u63a5\u7d9a\u3057\u307e\u3057\u305f\uff0e<\/p>\n<p>\u518d\u5ea6i2cdetect \u3092\u5b9f\u884c<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">&#x5B;pi@pi-01 ~]$ sudo i2cdetect 1\r\nWARNING! This program can confuse your I2C bus, cause data loss and worse!\r\nI will probe file \/dev\/i2c-1.\r\nI will probe address range 0x03-0x77.\r\nContinue? &#x5B;Y\/n] y\r\n     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f\r\n00:          -- -- -- -- -- -- -- -- -- -- -- -- -- \r\n10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- \r\n20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- \r\n30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- \r\n40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- \r\n50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- \r\n60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- -- \r\n70: -- -- -- -- -- -- -- --   \r\n<\/pre>\n<p>0x68\u306b\uff0c\u73fe\u308c\u307e\u3057\u305f\uff0e<\/p>\n<p>\u305d\u3057\u3066\uff0cC\u306e\u30bd\u30fc\u30b9\u306f\uff0c<a href=\"https:\/\/causeyourestuck.io\/2015\/12\/28\/gy-521-on-raspberry-pi-with-c\/\">GY-521 on Raspberry Pi in C++<\/a>\u306b\u3044\u3044\u306e\u304c\u3042\u308a\u307e\u3059\uff0e<\/p>\n<p>\u305f\u3060\uff0c\u79c1\u306e\u624b\u5143\u3067\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u305f\u3068\u3053\u308d\uff0c\u4ee5\u4e0b\u306e\u4fee\u6b63\u304c\u5fc5\u8981\u3067\u3057\u305f\uff0e<\/p>\n<ul>\n<li>fd == -1 \u306eretrun \u306e\u5f15\u6570\u304c\u306a\u3044\u306e\u3067\u30a8\u30e9\u30fc\uff0ereturn -1; \u3078\u4fee\u6b63\uff0e<\/li>\n<li>float \u3092%d \u3067\u8868\u793a\u3057\u3066\u3044\u308b\u306e\u3067\uff0c\u5909\u2026\uff0esigned char x, y, z; \u3078\u4fee\u6b63\uff0e<\/li>\n<li>\u52a0\u901f\u5ea6\u3092\u8868\u793a\u3057\u3066\u3044\u308b\u3063\u307d\u3044\u306e\u3067\uff0c\u300c\u52a0\u901f\u5ea6\u3092\u5f97\u308b\u306b\u306f\u300d\u306e\u90e8\u5206\u3078\u3068\u5909\u3048\u305f\u3089\uff0c\u5411\u304d\u306e\u5024\u3063\u307d\u3044\u306e\u306b\u306a\u308a\u307e\u3057\u305f\uff0eX, Y, Z\u306e0x43-0x47 => 0x3B-0x3F\u3078\u5909\u66f4\uff0e<\/li>\n<\/ul>\n<p>\u3068\u308a\u3042\u3048\u305a\uff0c8bit \u3067\u60c5\u5831\u53ce\u96c6\u53ef\u80fd\u306b\u306a\u308a\u307e\u3057\u305f\uff0e<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Raspberry PI \u3067I2C \u901a\u4fe1\u3059\u308b\u65b9\u6cd5\u3092\u6a21\u7d22\u4e2d\uff0e Raspbian \u3067 &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.kdel.org\/wp\/?p=940\"> <span class=\"screen-reader-text\">Raspbery pi on Fedora 23\u3067I2C\u3092\u4f7f\u3063\u3066\u30b8\u30e3\u30a4\u30ed\u306e\u5024\u53d6\u5f97\uff0e<\/span> \u7d9a\u304d\u3092\u8aad\u3080 &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[10,11,3,12,2,6],"tags":[],"class_list":["post-940","post","type-post","status-publish","format-standard","hentry","category-fawkes","category-fedora","category-logistics-league","category-raspberry-pi","category-robocup","category-setting"],"_links":{"self":[{"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/940","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=940"}],"version-history":[{"count":7,"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/940\/revisions"}],"predecessor-version":[{"id":947,"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/940\/revisions\/947"}],"wp:attachment":[{"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=940"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=940"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=940"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}