{"id":694,"date":"2017-01-03T13:16:32","date_gmt":"2017-01-03T05:16:32","guid":{"rendered":"http:\/\/www.withonly.com\/?p=694"},"modified":"2017-01-03T13:16:32","modified_gmt":"2017-01-03T05:16:32","slug":"firefly%e6%8e%a7%e5%88%b6%e8%87%aa%e5%b8%a6%e7%9a%84led%e7%81%af","status":"publish","type":"post","link":"https:\/\/blog.5danyuan.com\/?p=694","title":{"rendered":"Firefly\u63a7\u5236\u81ea\u5e26\u7684Led\u706f"},"content":{"rendered":"<p>\u5728\u524d\u9762\u7684\u6587\u7ae0\u4e2d\uff0c\u8863\u670d\u81ea\u5df1\u6d17\u63d0\u53ca\u4e3a\u4e86\u6253\u5f00\u81ea\u5e26\u7684Led\u706f\uff0c\u800c\u4e0d\u5f97\u4e0d\u5b89\u88c5golang\u7684\u73af\u5883\uff0c\u540e\u6765\u5728\u5b98\u7f51\u4e0a\u53d1\u73b0\u4e86\u4ed6\u4eec\u6709\u5f00\u6e90python\u7248\u672c\u7684\u5e93\uff1apyFireflyP\uff0c\u5f00\u6e90\u5730\u5740\u4e3ahttps:\/\/github.com\/T-Firefly\/pyFireflyP\u3002<\/p>\n<p>\u5bf9\u4e8elinux\u7cfb\u7edf\u800c\u8a00\uff0c\u5f88\u591a\u90fd\u5df2\u7ecf\u81ea\u5e26python\u4e86\uff0c\u800c\u4e14\u5b89\u88c5\u4e5f\u6bd4golang\u5bb9\u6613\u7684\u591a\u3002<\/p>\n<p>\u4ecegithub\u4e0aclone\u6216\u8005\u4e0b\u8f7d\u8fd9\u4e2a\u5305\uff0c\u7136\u540e\u8fdb\u5165\u5230\u76ee\u5f55\u4e0b\u5b89\u88c5\uff1a<\/p>\n<blockquote><p>cd pyFireflyP<br \/>\nsudo python setup.py install<\/p><\/blockquote>\n<p>\u6211\u7684Firefly\u8fd0\u884c\u540e\u4f1a\u62a5\u9519\uff0c\u663e\u793aFireflyP do not support &lt;Rockchip (Device Tree)&gt;! \u5e94\u8be5\u662f\u7cfb\u7edf\u5185\u6838\u6ca1\u6709\u6b63\u786e\u8d4b\u503c\uff0c\u6309\u7167\u5b98\u65b9\u7684\u8bf4\u6cd5\uff0c\u53ea\u9700\u8981\u4fee\u6539setup.py\u6587\u4ef6\uff0c\u628a fplat=check_plat() \u76f4\u63a5\u6539\u6210\uff1afplat=&#8217;rk3288&#8217;\uff0c\u7136\u540e\u518d\u6b21\u8fd0\u884c\u5b89\u88c5\u5373\u53ef\u3002<\/p>\n<p>\u5bf9\u4e8e\u6d4b\u8bd5\uff0c\u8fd0\u884c\u00a0sudo python demo\/gpio_test.py\uff0c\u5c31\u53ef\u4ee5\u770b\u5230Firefly\u4e0a\u7684\u84dd\u706f\u548c\u9ec4\u706f\u6765\u56de\u4ea4\u66ff\u663e\u793a\u7684\u6548\u679c\u4e86\u3002<\/p>\n<p>\u5bf9\u4e8e\u5185\u6838\u6ca1\u6709\u6b63\u786e\u8d4b\u503c\u7684\u95ee\u9898\uff0c\u4f30\u8ba1\u6211\u7684\u677f\u5b50\u662f\u65e9\u671f\u751f\u4ea7\u7684\uff0c\u5176\u4fe1\u606f\u5e76\u6ca1\u6709\u53ca\u65f6\u66f4\u65b0\u3002\u81f3\u4e8e\u73b0\u5728\u662f\u5426\u5df2\u7ecf\u66f4\u65b0\u4e0d\u5f97\u800c\u77e5\u3002<\/p>\n<p>\u5f53\u7136\uff0c\u5bf9\u4e8e\u5b98\u7f51wiki\u4e0a\u7684\u53e6\u5916\u4e00\u4e2a\u8bbe\u5907\u5199\u5165\u7684\u65b9\u6cd5\uff1a<\/p>\n<blockquote><p>echo 1 &gt;\/sys\/class\/leds\/firefly:blue:power\/brightness \u00a0\/\/\u84dd\u706f\u4eae<\/p><\/blockquote>\n<p>\u5728\u6700\u8fd1\u7684\u56fa\u4ef6\u91cc\u5e76\u4e0d\u80fd\u5b9e\u73b0\uff0c\u65e9\u671f\u7684\u56fa\u4ef6\u786e\u5b9e\u662f\u6709\u3002\u8fd9\u91cc\u8863\u670d\u81ea\u5df1\u6d17\u771f\u5fc3\u662f\u8981\u72e0\u72e0\u5730\u5410\u69fd\u4e00\u756a\uff0c\u5b8c\u5168\u6ca1\u6709\u8003\u8651\u5230\u50cf\u6211\u4eec\u8fd9\u6837\u7684\u5c0f\u767d\uff0c\u4ee5\u4e3a\u6240\u6709\u7684\u4eba\u90fd\u4f1a\u81ea\u5df1\u7f16\u8bd1\u56fa\u4ef6\u3002<\/p>\n<p>\u4e0a\u9762\u63d0\u53ca\u76842\u79cd\u65b9\u6cd5\uff0c\u867d\u7136\u90fd\u662f\u8c03\u7528GPIO\uff0c\u4f46\u662f\u662f\u76f8\u4e92\u72ec\u7acb\u7684\uff0c\u5982\u679c\u4e00\u8d77\u4f7f\u7528\u7684\u8bdd\uff0c\u53ef\u80fd\u4f1a\u51fa\u73b0\u610f\u60f3\u4e0d\u5230\u7684\u540e\u679c\u3002\u4e0d\u8fc7\u5c31\u76ee\u524d\u6765\u770b\uff0c\u5e94\u8be5\u6ca1\u6709\u8fd9\u4e2a\u98ce\u9669\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u524d\u9762\u7684\u6587\u7ae0\u4e2d\uff0c\u8863\u670d\u81ea\u5df1\u6d17\u63d0\u53ca\u4e3a\u4e86\u6253\u5f00\u81ea\u5e26\u7684Led\u706f\uff0c\u800c\u4e0d\u5f97\u4e0d\u5b89\u88c5golang\u7684\u73af\u5883\uff0c\u540e\u6765\u5728\u5b98\u7f51\u4e0a\u53d1\u73b0\u4e86\u4ed6\u4eec\u6709 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[279,5],"tags":[283,286],"class_list":["post-694","post","type-post","status-publish","format-standard","hentry","category-firefly","category-daily","tag-firefly","tag-gpio"],"_links":{"self":[{"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/posts\/694","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=694"}],"version-history":[{"count":0,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/posts\/694\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=694"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=694"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=694"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}