{"id":774,"date":"2015-06-29T18:35:41","date_gmt":"2015-06-29T09:35:41","guid":{"rendered":"https:\/\/hack.gpl.jp\/?p=774"},"modified":"2015-06-29T18:35:41","modified_gmt":"2015-06-29T09:35:41","slug":"post-774","status":"publish","type":"post","link":"https:\/\/hack.gpl.jp\/2015\/06\/29\/post-774.html","title":{"rendered":"pi2 \u3067LED"},"content":{"rendered":"

\u6211\u304c\u5bb6\u306b\u3082\u3001PI2 \u304c\u6765\u307e\u3057\u305f\u3002\u5f53\u521d\u3001GW\u660e\u3051\u306bRS\u3055\u3093\u306b\u767a\u6ce8\u3057\u3066\u304a\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u5fd9\u3057\u304f\u3066\u8377\u7269\u3092\u53d6\u308a\u306b\u3044\u304f\u6687\u304c\u7121\u304f\u3066\u307b\u3063\u3066\u304a\u3044\u305f\u3089\u3001\u8fd4\u54c1\u6271\u3044\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002\u3046\u3046\u3080\u3001\u3001\u3001<\/p>\n

 <\/p>\n

\u3067\u3001\u3082\u3046\u4e00\u5ea6\u983c\u3080\u306e\u3082\u6c17\u304c\u5f15\u3051\u305f\u306e\u3067\u9001\u6599\u306a\u3069\u3092\u8003\u3048\u308b\u3068\u3001AliExpress \u3067\u983c\u3093\u3060\u307b\u3046\u304c\u9001\u6599\u5206\u3060\u3051\u5b89\u3044\u3063\u3066\u3053\u3068\u3082\u3042\u308a\u305d\u3063\u3061\u7d4c\u7531\u3067\u30b2\u30c3\u30c8\u3057\u307e\u3057\u305f\u3002\u30b1\u30fc\u30b9\u306f\u3001RS\u3055\u3093\u304b\u3089\u30b2\u30c3\u30c8\u3057\u305f\u3082\u306e\u3067\u3059\u3002<\/p>\n

\"\u5199\u771f <\/p>\n

\u30d1\u30c3\u30b1\u30fc\u30b8\u306f\u3001\u3053\u3093\u306a\u611f\u3058\u3067\u3059\u3002element14.com \u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u3088\u3046\u3067\u3059\u306d\u3002<\/p>\n

\"\u5199\u771f <\/p>\n

\u6c17\u306b\u5165\u3063\u305f\u30b1\u30fc\u30b9\u306b\u53ce\u3081\u308b\u3068\u3053\u3093\u306a\u611f\u3058\u3067\u3059\u3002\u3075\u305f\u306f\u306f\u3081\u8fbc\u307f\u5f0f\u3067\u3001\u30b1\u30fc\u30d6\u30eb\u306e\u5206\u3060\u3051\u3059\u304d\u307e\u304c\u3042\u308b\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u51fa\u305b\u307e\u3059\u3002<\/p>\n

\"\u5199\u771f <\/p>\n

GPIO Pin\u306e\u914d\u5217\u306f\u3001\u4ee5\u4e0b\u306e\u8868\u3092\u898b\u307e\u3057\u305f\u300201 pin \u306f\u5199\u771f\u3067\u3044\u3046\u3068\u3001\u5de6\u4e0b\u306e\u53f3\u5074\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n

\"GPIO_Pi2\" <\/p>\n

\u30b3\u30fc\u30c9\u306f\u3001python \u3067rpi.GPIO \u3068\u3044\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u5229\u7528\u3057\u307e\u3057\u305f\u3002<\/p>\n

#!\/usr\/bin\/env python\nimport RPi.GPIO as GPIO\nimport time\nGPIO.setmode(GPIO.BOARD)\nGPIO.setup(11, GPIO.OUT)\nwhile True:\n    GPIO.output(11, True)\n    time.sleep(2)\n    GPIO.output(11, False)\n    time.sleep(2)<\/pre>\n

\u3088\u308a\u308f\u304b\u308a\u3084\u3059\u3044\u8aac\u660e\u306f\u3001\u9ed2\u732b\u306e\u30c7\u30eb\u30bf\u3055\u3093\u306eBlog<\/a> \u3092\u53c2\u8003\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n

\"\u5199\u771f <\/p>\n<\/p>\n

\u30b3\u30fc\u30c9\u5b9f\u884c\u4e2d\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u8b66\u544a\u304c\u3067\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n

junkhack@raspberrypi:~\/gpio$ sudo python gpio11.py\ngpio11.py:5: RuntimeWarning: This channel is already in use, continuing anyway.  Use GPIO.setwarnings(False) to disable warnings.\n  GPIO.setup(11, GPIO.OUT)<\/pre>\n

 <\/p>\n

\u3069\u3046\u3084\u3089\u3001GPIO.cleanup() \u3057\u306a\u3044\u3068\u3001CTL + C \u3067\u30d6\u30ec\u30a4\u30af\u3057\u3066\u518d\u5ea6\u5b9f\u884c\u3059\u308b\u3068\u4e0a\u8a18\u306e\u3088\u3046\u306b\u51fa\u3066\u3057\u307e\u3046\u3088\u3046\u3067\u3059\u3002\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u7d42\u4e86\u5f8c\u3082GPIO Pin\u304b\u3089\u51fa\u529b\u3055\u308c\u308b\u306e\u3067\u3001try \u3067 CTL + C \u3092\u53d7\u3051\u3066\u51e6\u7406\u3059\u308b\u3068\u3088\u3044\u3088\u3046\u3067\u3059\u3002<\/p>\n

#!\/usr\/bin\/env python\nimport RPi.GPIO as GPIO\nimport time\nGPIO.setmode(GPIO.BOARD)\nGPIO.setup(11, GPIO.OUT)\nGPIO.setwarnings(False)\ntry:\n    while True:\n        GPIO.output(11, True)\n        time.sleep(2)\n        GPIO.output(11, False)\n        time.sleep(2)\nexcept KeyboardInterrupt:\n        GPIO.cleanup()<\/pre>\n

 <\/p>\n

\u306a\u308b\u307b\u3069\u3067\u3059\u306d\u3002\u30c6\u30b9\u30bf\u3067\u306f\u3001True \u306f3.3v \u51fa\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n

Pi2 \u3067 LED \u5236\u5fa1\u304c\u51fa\u6765\u307e\u3057\u305f\u3002arduino \u3084 ESP8266 \u306a\u3069\u3069\u9023\u643a\u3059\u308b\u3068\u9762\u767d\u305d\u3046\u3067\u3059\u306d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u6211\u304c\u5bb6\u306b\u3082\u3001PI2 \u304c\u6765\u307e\u3057\u305f\u3002\u5f53\u521d\u3001GW\u660e\u3051\u306bRS\u3055\u3093\u306b\u767a\u6ce8\u3057\u3066\u304a\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u5fd9\u3057\u304f\u3066\u8377\u7269\u3092\u53d6\u308a\u306b\u3044\u304f\u6687\u304c\u7121\u304f\u3066\u307b\u3063\u3066\u304a\u3044\u305f\u3089\u3001\u8fd4\u54c1\u6271\u3044\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002\u3046\u3046\u3080\u3001\u3001\u3001   \u3067\u3001\u3082\u3046\u4e00\u5ea6\u983c\u3080\u306e\u3082\u6c17\u304c\u5f15\u3051\u305f […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","footnotes":""},"categories":[69],"tags":[],"acf":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"post-thumbnail":false},"uagb_author_info":{"display_name":"JunkHack","author_link":"https:\/\/hack.gpl.jp\/author\/junkhack\/"},"uagb_comment_info":0,"uagb_excerpt":"\u6211\u304c\u5bb6\u306b\u3082\u3001PI2 \u304c\u6765\u307e\u3057\u305f\u3002\u5f53\u521d\u3001GW\u660e\u3051\u306bRS\u3055\u3093\u306b\u767a\u6ce8\u3057\u3066\u304a\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u5fd9\u3057\u304f\u3066\u8377\u7269\u3092\u53d6\u308a\u306b\u3044\u304f\u6687\u304c…","_links":{"self":[{"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/posts\/774"}],"collection":[{"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/comments?post=774"}],"version-history":[{"count":0,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/posts\/774\/revisions"}],"wp:attachment":[{"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/media?parent=774"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/categories?post=774"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/tags?post=774"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}