{"id":148,"date":"2018-04-06T16:41:36","date_gmt":"2018-04-06T08:41:36","guid":{"rendered":"http:\/\/www.kejidana.com\/?p=148"},"modified":"2018-04-06T16:41:36","modified_gmt":"2018-04-06T08:41:36","slug":"%e6%a0%91%e8%8e%93%e6%b4%be%e4%b8%8a%e7%94%a8nodejs%e6%8e%a7%e5%88%b6gpio","status":"publish","type":"post","link":"http:\/\/www.kejidana.com\/?p=148","title":{"rendered":"\u6811\u8393\u6d3e\u4e0a\u7528nodejs\u63a7\u5236gpio"},"content":{"rendered":"<pre class=\"lang:default decode:true \">npm install pi-gpio<\/pre>\n<p>\u5982\u679c\u8fd0\u884c\u63d0\u793agpio-admin\u76f8\u5173\u95ee\u9898\u00a0 \u9700\u8981\u5b89\u88c5gpio-admin<\/p>\n<p>&nbsp;<\/p>\n<pre><code>npm update pi-gpio\n<\/code><\/pre>\n<p>If the problem still exists, build the newest version of gpio-admin yourself.<\/p>\n<p>Choose a directory you want to put gpio-admin in, and run<\/p>\n<pre><code>git clone https:\/\/github.com\/quick2wire\/quick2wire-gpio-admin.git\ncd quick2wire-gpio-admin\n<\/code><\/pre>\n<p>If <code>src\/gpio-admin.c<\/code> has<\/p>\n<pre><code>int size = snprintf(path, PATH_MAX, \"\/sys\/devices\/virtual\/gpio\/gpio%u\/%s\", pin, filename);\n<\/code><\/pre>\n<p>change it to<\/p>\n<pre><code>int size = snprintf(path, PATH_MAX, GPIO_CLASS_PATH \"gpio%u\/%s\", pin, filename);\n<\/code><\/pre>\n<p>Then, run make<\/p>\n<p>Then, run<\/p>\n<pre class=\"\"><code>make install\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>npm install pi-gpio \u5982\u679c\u8fd0\u884c\u63d0\u793agpio-admin\u76f8\u5173\u95ee\u9898\u00a0 \u9700\u8981\u5b89\u88c5gpio [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,36],"tags":[],"class_list":["post-148","post","type-post","status-publish","format-standard","hentry","category-nodejs","category-36"],"_links":{"self":[{"href":"http:\/\/www.kejidana.com\/index.php?rest_route=\/wp\/v2\/posts\/148","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.kejidana.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.kejidana.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.kejidana.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.kejidana.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=148"}],"version-history":[{"count":0,"href":"http:\/\/www.kejidana.com\/index.php?rest_route=\/wp\/v2\/posts\/148\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.kejidana.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.kejidana.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=148"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.kejidana.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}