<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://mochiu.net/index.php?action=history&amp;feed=atom&amp;title=RPi.GPIO%E3%81%A7Raspberry_Pi%E3%81%AE%E5%88%B6%E5%BE%A1</id>
	<title>RPi.GPIOでRaspberry Piの制御 - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://mochiu.net/index.php?action=history&amp;feed=atom&amp;title=RPi.GPIO%E3%81%A7Raspberry_Pi%E3%81%AE%E5%88%B6%E5%BE%A1"/>
	<link rel="alternate" type="text/html" href="https://mochiu.net/index.php?title=RPi.GPIO%E3%81%A7Raspberry_Pi%E3%81%AE%E5%88%B6%E5%BE%A1&amp;action=history"/>
	<updated>2026-06-28T20:47:37Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://mochiu.net/index.php?title=RPi.GPIO%E3%81%A7Raspberry_Pi%E3%81%AE%E5%88%B6%E5%BE%A1&amp;diff=1146&amp;oldid=prev</id>
		<title>Wiki: /* RPi.GPIOライブラリのインストール */</title>
		<link rel="alternate" type="text/html" href="https://mochiu.net/index.php?title=RPi.GPIO%E3%81%A7Raspberry_Pi%E3%81%AE%E5%88%B6%E5%BE%A1&amp;diff=1146&amp;oldid=prev"/>
		<updated>2020-04-09T08:54:05Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;RPi.GPIOライブラリのインストール&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2020年4月9日 (木) 17:54時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l2&quot;&gt;2行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;2行目:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;RPi.GPIOとは、PythonでRaspberry Piの制御するためのライブラリである。&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;RPi.GPIOとは、PythonでRaspberry Piの制御するためのライブラリである。&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Raspberry Piを起動して、RPi.GPIOがインストールされているか確認する。&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Raspberry Piを起動して、RPi.GPIOがインストールされているか確認する。&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  pip list&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sudo &lt;/ins&gt;pip list&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;まだ、RPi.GPIOをインストールしていない場合、以下のコマンドを実行してインストールする。&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;まだ、RPi.GPIOをインストールしていない場合、以下のコマンドを実行してインストールする。&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  pip install RPi.GPIO&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sudo &lt;/ins&gt;pip install RPi.GPIO&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;パッケージ管理システムを使用してインストールする場合、以下のコマンドを実行する。&amp;lt;br&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; sudo apt-get install python-rpi.gpio&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mochiu_wiki:diff:1.41:old-1145:rev-1146:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Wiki</name></author>
	</entry>
	<entry>
		<id>https://mochiu.net/index.php?title=RPi.GPIO%E3%81%A7Raspberry_Pi%E3%81%AE%E5%88%B6%E5%BE%A1&amp;diff=1145&amp;oldid=prev</id>
		<title>Wiki: ページの作成:「== RPi.GPIOライブラリのインストール == RPi.GPIOとは、PythonでRaspberry Piの制御するためのライブラリである。&lt;br&gt; Raspberry Piを起動し…」</title>
		<link rel="alternate" type="text/html" href="https://mochiu.net/index.php?title=RPi.GPIO%E3%81%A7Raspberry_Pi%E3%81%AE%E5%88%B6%E5%BE%A1&amp;diff=1145&amp;oldid=prev"/>
		<updated>2020-04-09T08:33:02Z</updated>

		<summary type="html">&lt;p&gt;ページの作成:「== RPi.GPIOライブラリのインストール == RPi.GPIOとは、PythonでRaspberry Piの制御するためのライブラリである。&amp;lt;br&amp;gt; Raspberry Piを起動し…」&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== RPi.GPIOライブラリのインストール ==&lt;br /&gt;
RPi.GPIOとは、PythonでRaspberry Piの制御するためのライブラリである。&amp;lt;br&amp;gt;&lt;br /&gt;
Raspberry Piを起動して、RPi.GPIOがインストールされているか確認する。&amp;lt;br&amp;gt;&lt;br /&gt;
 pip list&lt;br /&gt;
まだ、RPi.GPIOをインストールしていない場合、以下のコマンドを実行してインストールする。&amp;lt;br&amp;gt;&lt;br /&gt;
 pip install RPi.GPIO&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== RPi.GPIOライブラリの使用方法 ==&lt;br /&gt;
===== ライブラリのインポート =====&lt;br /&gt;
 import RPi.GPIO as GPIO&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===== GPIOの入出力の設定 =====&lt;br /&gt;
 GPIO.setup()&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===== GPIO番号指定モードの設定 =====&lt;br /&gt;
* Broadcom SoCのGPIOピン番号での指定&lt;br /&gt;
*: Raspberry Pi 3Bでは、Broadcom SoCを使用しているので、ピンを指定して入出力の設定を行うことができる。&lt;br /&gt;
 GPIO.setmode(GPIO.BCM) # GPIO設定&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* ボードのピン番号での指定&lt;br /&gt;
 GPIO.setmode(GPIO.BOARD) # ボードのピン番号&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===== GPIOの入出力(DDR)の設定 =====&lt;br /&gt;
出力ピン設定&amp;lt;br&amp;gt;&lt;br /&gt;
 GPIO.setup(ピン番号, GPIO.OUT) #出力指定&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
入力ピン指定&amp;lt;br&amp;gt;&lt;br /&gt;
 GPIO.setup(ピン番号, GPIO.IN) #入力指定&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===== 入出力 =====&lt;br /&gt;
出力&amp;lt;br&amp;gt;&lt;br /&gt;
 GPIO.output(ピン番号, 1)  # 3.3[V]出力&lt;br /&gt;
 GPIO.output(ピン番号, 0)  # 0.0[V]出力&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
入力&amp;lt;br&amp;gt;&lt;br /&gt;
 GPIO.input(ピン番号)      #入力(この関数を呼ぶと値が返るので、その結果を処理する必要がある&lt;br /&gt;
 print GPIO.input(ピン番号)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
[[カテゴリ:Python]][[カテゴリ:Raspberry_Pi]]&lt;/div&gt;</summary>
		<author><name>Wiki</name></author>
	</entry>
</feed>