{"id":212,"date":"2018-04-19T00:19:02","date_gmt":"2018-04-18T15:19:02","guid":{"rendered":"http:\/\/www7390uo.sakura.ne.jp\/wordpress\/?p=212"},"modified":"2022-07-17T11:54:13","modified_gmt":"2022-07-17T02:54:13","slug":"raspberry-pi-3-model-b%e3%81%ae%e6%9c%ac%e4%bd%93%e3%81%ab%e4%bb%98%e3%81%84%e3%81%a6%e3%81%84%e3%82%8bled%e3%81%ae%e7%82%b9%e6%bb%85%e3%82%92%e8%87%aa%e5%9c%a8%e3%81%ab%e6%93%8d%e4%bd%9c%e3%81%99","status":"publish","type":"post","link":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/archives\/212","title":{"rendered":"Raspberry Pi 3 Model B\u306e\u57fa\u76e4\u306b\u4ed8\u3044\u3066\u3044\u308bLED\u306e\u70b9\u6ec5\u3092\u81ea\u5728\u306b\u64cd\u4f5c\u3059\u308b"},"content":{"rendered":"\n<p>Raspberry Pi 3 Model B<br>OS: Raspbian Stretch lite March 2018<\/p>\n\n\n\n<p>\u5404\u8272\u306eLED\u306b\u4fc2\u308b\u30d5\u30a1\u30a4\u30eb\u306f\u6b21\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u914d\u7f6e\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u7dd1\uff1a\/sys\/class\/leds\/led0\/<\/li><li>\u6a59\uff1a\/sys\/class\/leds\/led1\/<\/li><\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><a href=\"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-content\/uploads\/2018\/04\/rpi3led1.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-content\/uploads\/2018\/04\/rpi3led1.jpg\" alt=\"\" class=\"wp-image-214\" width=\"623\" height=\"354\" srcset=\"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-content\/uploads\/2018\/04\/rpi3led1.jpg 1246w, https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-content\/uploads\/2018\/04\/rpi3led1-300x170.jpg 300w, https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-content\/uploads\/2018\/04\/rpi3led1-1024x582.jpg 1024w, https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-content\/uploads\/2018\/04\/rpi3led1-768x436.jpg 768w\" sizes=\"auto, (max-width: 623px) 100vw, 623px\" \/><\/a><figcaption>\u56f31.\u5404\u8272\u306eLED\u306e\u660e\u6ec5\u3092\u53f8\u308b\u30d5\u30a1\u30a4\u30eb\u306e\u3042\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea<\/figcaption><\/figure>\n<\/div>\n\n\n<p>trigger\u30d5\u30a1\u30a4\u30eb\u306b\u306fLED\u3092\u70b9\u6ec5\u3055\u305b\u308b\u5207\u3063\u639b\u3051\u304c\u8a18\u3055\u308c\u3066\u3044\u308b\u3002\u30d6\u30e9\u30b1\u30c3\u30c8\u306b\u5305\u307e\u308c\u305f\u5358\u8a9e\u304c\u5207\u3063\u639b\u3051\u3068\u306a\u308b\u30a4\u30d9\u30f3\u30c8\u3067\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u7dd1\u306eLED\u304c<code>mmc0<\/code>\u3001\u30aa\u30ec\u30f3\u30b8\u306eLED\u306f<code>input<\/code>\u304c\u9078\u629e\u3055\u308c\u3066\u3044\u305f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ cat \/sys\/class\/leds\/led0\/trigger\nnone (snip) default-on input panic mmc1 <strong class=\"orange\">[mmc0]<\/strong> rfkill-any rfkill0 rfkill1\n\n$ cat \/sys\/class\/leds\/led1\/trigger\nnone (snip) default-on <strong class=\"orange\">[input]<\/strong> panic mmc1 mmc0 rfkill-any rfkill0 rfkill1<\/pre>\n\n\n\n<p>\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u5bfe\u3057\u3066\u30c8\u30ea\u30ac\u30fc\u540d\u3092\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3059\u308b\u3053\u3068\u3067\u9078\u629e\u5185\u5bb9\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># echo none &gt;\/sys\/class\/leds\/led0\/trigger<\/pre>\n\n\n\n<p>mmc0\u306fSD\u30ab\u30fc\u30c9\u306b\u30a2\u30af\u30bb\u30b9\u304c\u3042\u3063\u305f\u6642\u306b\u70b9\u6ec5\u3059\u308b\u3068\u3044\u3046\u3053\u3068\u3067\u3042\u308b\u3002input\u306e\u8a73\u7d30\u306f\u63a2\u3057\u5f53\u3066\u3089\u308c\u306a\u304b\u3063\u305f\u3051\u308c\u3069\u3082\u3001\u4f55\u3057\u308dinput\u3067\u3042\u308b\u304b\u3089\u306a\u3093\u3089\u304b\u306e\u5165\u529b\u3067\u3042\u308d\u3046\u3068\u601d\u3046\u3002heartbeat\u3084timer\u3092\u9078\u629e\u3059\u308b\u3068\u898f\u5247\u7684\u306a\u660e\u6ec5\u3068\u306a\u308b\u3002\u3058\u3044\u3063\u3068\u773a\u3081\u3066\u3044\u308b\u3068\u307e\u3070\u3086\u3055\u3067\u76ee\u304c\u6f70\u308c\u3066\u3057\u307e\u3046\u3002<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-content\/uploads\/2018\/04\/rpi3led2.gif\"><img loading=\"lazy\" decoding=\"async\" width=\"135\" height=\"144\" src=\"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-content\/uploads\/2018\/04\/rpi3led2.gif\" alt=\"\" class=\"wp-image-215\"\/><\/a><figcaption>\u56f32. heartbeat\u3092\u9078\u629e\u3057\u305f\u3068\u304d\u306eLED\u660e\u6ec5\u306e\u3088\u3046\u3059<\/figcaption><\/figure>\n<\/div>\n\n\n<p>\u70b9\u6ec5\u306e\u5236\u5fa1\u306f<code>brightness<\/code>\u3067\u304a\u3053\u306a\u3046\u30020\u304b\u3089255\u307e\u3067\u306e\u5024\u3092\u53d6\u308a0\u3067\u6d88\u706f\u30011\uff5e255\u3067\u70b9\u706f\u3059\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo su -c \"echo 0 &gt; \/sys\/class\/leds\/led0\/brightness\"\n$ sudo su -c \"echo 1 &gt; \/sys\/class\/leds\/led0\/brightness\"<\/pre>\n\n\n\n<p>\u63a1\u7528\u3057\u305f\u5024\u306e\u5927\u5c0f\u3067\u8f1d\u5ea6\u304c\u5909\u3048\u3089\u308c\u308b\u3088\u3046\u306b\u898b\u3048\u308b\u3051\u308c\u3069\u3082\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u304c\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u306a\u3044\u3089\u3057\u304f\u660e\u308b\u3055\u306f\u4e00\u901a\u308a\u3067\u3042\u308b\u3002\u306a\u304abrightness\u306e\u6570\u5024\u30920\u306b\u5909\u66f4\u3059\u308b\u3068trigger\u306f\u52dd\u624b\u306b<code>none<\/code>\u3078\u5909\u66f4\u3055\u308c\u3066\u3044\u305f\u3002<\/p>\n\n\n\n<p>\u4e00\u79d2\u304a\u304d\u306b\u7dd1\u306eLED\u3092\u660e\u6ec5\u3055\u305b\u308b\u62d9\u3044\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8<code>led.sh<\/code>\u3092\u62f5\u3048\u308b\u3068\u6982\u306d\u3053\u3093\u306a\u5177\u5408\u3068\u306a\u3063\u305f\u3002\u3042\u3068\u306f<code>sudo bash led.sh<\/code>\u3067\u5b9f\u884c\u3059\u308b\u3068\u7dd1\u306eLED\u304c\u8a2d\u8a08\u901a\u308a\u306b\u660e\u6ec5\u3092\u7e70\u308a\u8fd4\u3057\u305f\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#!\/bin\/bash\n\nif [ $(id -u) != '0' ]; then\n  echo 'Run as root.'\n  exit 1\nfi\n\nGREEN='\/sys\/class\/leds\/led0'\ntrap 'echo mmc0 > ${GREEN}\/trigger; exit 1' 1 2 9 15\necho none > ${GREEN}\/trigger\n\nwhile true\ndo\n  echo 0 > ${GREEN}\/brightness\n  sleep 1\n  echo 1 > ${GREEN}\/brightness\n  sleep 1\ndone<\/pre>\n\n\n\n<h3 class=\"link\">\u53c2\u8003:<\/h3>\n<ul>\n <li><a href=\"\nhttps:\/\/www.raspberrypi.org\/forums\/viewtopic.php?t=12530\">Can we control the on-board leds<\/a><\/li>\n<li><a href=\"https:\/\/raspberrypi.stackexchange.com\/questions\/697\/how-do-i-control-the-system-leds-using-my-software\">How do I control the system LEDs using my software?<\/a>\n<\/li>\n<li><a href=\"https:\/\/raspberrypi.stackexchange.com\/questions\/69674\/are-there-other-act-led-trigger-options-besides-mmc-and-heartbeat\">Are there other act_led_trigger options besides \u201cmmc\u201d and \u201cheartbeat\u201d?<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Raspberry Pi 3 Model BOS: Raspbian Stretch lite March 2018 \u5404\u8272\u306eLED\u306b\u4fc2\u308b\u30d5\u30a1\u30a4\u30eb\u306f\u6b21\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u914d\u7f6e\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u3067\u3042\u308b\u3002 \u7dd1\uff1a\/sys\/class\/leds\/led0\/ \u6a59\uff1a\/sys\/class\/leds\/led1\/ trigger\u30d5\u30a1\u30a4\u30eb\u306b\u306fLED\u3092\u70b9\u6ec5\u3055\u305b\u308b\u5207\u3063\u639b\u3051\u304c\u8a18\u3055\u308c\u3066\u3044\u308b\u3002\u30d6\u30e9\u30b1\u30c3\u30c8\u306b\u5305\u307e\u308c\u305f\u5358\u8a9e\u304c\u5207\u3063\u639b\u3051\u3068\u306a\u308b\u30a4\u30d9 &#8230; <a title=\"Raspberry Pi 3 Model B\u306e\u57fa\u76e4\u306b\u4ed8\u3044\u3066\u3044\u308bLED\u306e\u70b9\u6ec5\u3092\u81ea\u5728\u306b\u64cd\u4f5c\u3059\u308b\" class=\"read-more\" href=\"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/archives\/212\" aria-label=\"Raspberry Pi 3 Model B\u306e\u57fa\u76e4\u306b\u4ed8\u3044\u3066\u3044\u308bLED\u306e\u70b9\u6ec5\u3092\u81ea\u5728\u306b\u64cd\u4f5c\u3059\u308b \u306b\u3064\u3044\u3066\u3055\u3089\u306b\u8aad\u3080\">\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":972,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[166,183],"tags":[274],"class_list":["post-212","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-raspberry-pi","category-183","tag-led"],"views":5123,"_links":{"self":[{"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/posts\/212","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/comments?post=212"}],"version-history":[{"count":0,"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/posts\/212\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/media\/972"}],"wp:attachment":[{"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/media?parent=212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/categories?post=212"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/tags?post=212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}