{"id":2870,"date":"2016-06-06T21:36:15","date_gmt":"2016-06-06T12:36:15","guid":{"rendered":"http:\/\/oohito.com\/nqthm\/?p=2870"},"modified":"2016-06-06T21:36:15","modified_gmt":"2016-06-06T12:36:15","slug":"wiringpi2-for-python%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/oohito.com\/nqthm\/archives\/2870","title":{"rendered":"WiringPi2 for Python\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b"},"content":{"rendered":"<p><a href=\"http:\/\/oohito.com\/nqthm\/archives\/2867\">\u524d\u56de\u306e\u8a18\u4e8b<\/a>\u306b\u5f15\u304d\u7d9a\u3044\u3066 Raspberry Pi A+ \u3078\u3001\u3082\u308d\u3082\u308d\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002<\/p>\n<h2>Python\u958b\u767a\u7528\u30c4\u30fc\u30eb\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p>python-pip\u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u306e\u3088\u3046\u306a\u306e\u3067\u3001python-dev\u3060\u3051\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002<\/p>\n<pre>sudo apt-get install python-dev<\/pre>\n<h2>WiringPi2\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p>wiringipi2\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002\u4ee5\u524d\u3088\u308a\u305a\u3063\u3068\u7c21\u5358\u306b\u306a\u3063\u305f\u3002<\/p>\n<pre>sudo pip install wiringpi2<\/pre>\n<p>\u3044\u308d\u3044\u308d\u8b66\u544a\u304c\u51fa\u308b\u3051\u3069\u3001\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u7d42\u308f\u308c\u3070OK\u3002<\/p>\n<pre>Successfully installed wiringpi2 wiringpi\nCleaning up...<\/pre>\n<h2>\u8a66\u904b\u8ee2<\/h2>\n<pre>$ python\nPython 2.7.9 (default, Mar  8 2015, 00:52:26)\n[GCC 4.9.2] on linux2\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import wiringpi2\n__main__:1: DeprecationWarning: The wiringpi2 module has been deprecated, please 'import wiringpi' instead.<\/pre>\n<p>\u4ee5\u524d\u306e\u3088\u3046\u306bwiringpi2\u3092import\u3059\u308b\u3068\u3001deprecated\u3060\u3068\u6012\u3089\u308c\u308b\u3002\u7d20\u76f4\u306bwiringpi\u3092import\u3059\u308c\u3070\u3088\u3044\u3002<\/p>\n<pre>>>> import wiringpi\n>>> wiringpi.piBoardRev()\n2\n>>> wiringpi.wiringPiSetup()\nwiringPiSetup: Must be root. (Did you forget sudo?)\n$<\/pre>\n<p>wiringPiSetup\u3092\u4f7f\u3046\u306b\u306froot\u6a29\u9650\u304c\u5fc5\u8981\u306a\u306e\u3067\u3001sudo python\u3068\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3002<br \/>\n\u4ee5\u4e0a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u306e\u8a18\u4e8b\u306b\u5f15\u304d\u7d9a\u3044\u3066 Raspberry Pi A+ \u3078\u3001\u3082\u308d\u3082\u308d\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002 Python\u958b\u767a\u7528\u30c4\u30fc\u30eb\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb python-pip\u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u306e\u3088\u3046\u306a\u306e\u3067\u3001python-dev\u3060\u3051\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,10],"tags":[],"class_list":["post-2870","post","type-post","status-publish","format-standard","hentry","category-python","category-raspberry-pi"],"_links":{"self":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/posts\/2870","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/comments?post=2870"}],"version-history":[{"count":0,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/posts\/2870\/revisions"}],"wp:attachment":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/media?parent=2870"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/categories?post=2870"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/tags?post=2870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}