{"id":727,"date":"2015-02-02T22:55:59","date_gmt":"2015-02-02T22:55:59","guid":{"rendered":"http:\/\/www.incredigeek.com\/home\/?p=727"},"modified":"2015-02-02T22:59:27","modified_gmt":"2015-02-02T22:59:27","slug":"control-led-from-command-line-raspberry-pi","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/control-led-from-command-line-raspberry-pi\/","title":{"rendered":"Control LED from Command Line &#8211; Raspberry Pi"},"content":{"rendered":"<p>Replace &#8220;4&#8221; with the GPIO pin your using.<\/p>\n<pre>echo \"4\" &gt; \/sys\/class\/gpio\/export\r\n<\/pre>\n<p>Setup the direction.\u00a0 If it was a button or switch we would change &#8220;out&#8221; to &#8220;in&#8221;.<\/p>\n<pre>echo \"out\" &gt; \/sys\/class\/gpio\/gpio4\/direction\r\n<\/pre>\n<p>Turn the LED on.<\/p>\n<pre>echo \"1\" &gt; \/sys\/class\/gpio\/gpio4\/value\r\n<\/pre>\n<p>Turn the LED off.<\/p>\n<pre>echo \"0\" &gt; \/sys\/class\/gpio\/gpio4\/value<\/pre>\n<p>1 = on and 0 = off.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Replace &#8220;4&#8221; with the GPIO pin your using. echo &#8220;4&#8221; &gt; \/sys\/class\/gpio\/export Setup the direction.\u00a0 If it was a button or switch we would change &#8220;out&#8221; to &#8220;in&#8221;. echo &#8220;out&#8221; &gt; \/sys\/class\/gpio\/gpio4\/direction Turn the LED on. echo &#8220;1&#8221; &gt; \/sys\/class\/gpio\/gpio4\/value &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/control-led-from-command-line-raspberry-pi\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[91],"tags":[211,210,105,92],"class_list":["post-727","post","type-post","status-publish","format-standard","hentry","category-raspberry-pi","tag-bash","tag-led","tag-pi","tag-raspberry-pi-2"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/727","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=727"}],"version-history":[{"count":6,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/727\/revisions"}],"predecessor-version":[{"id":2515,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/727\/revisions\/2515"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=727"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=727"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=727"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}