<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://elinux.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://elinux.org/index.php?title=RPi_ADC_I2C_Python&amp;feed=atom&amp;action=history</id>
		<title>RPi ADC I2C Python - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://elinux.org/index.php?title=RPi_ADC_I2C_Python&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=RPi_ADC_I2C_Python&amp;action=history"/>
		<updated>2013-05-21T10:43:07Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.21alpha</generator>

	<entry>
		<id>http://elinux.org/index.php?title=RPi_ADC_I2C_Python&amp;diff=211076&amp;oldid=prev</id>
		<title>Bgirardot: Changed PYTHONPATH to point to root of the directory instead of src/ directory - See discussion page for reason</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=RPi_ADC_I2C_Python&amp;diff=211076&amp;oldid=prev"/>
				<updated>2013-01-15T00:44:10Z</updated>
		
		<summary type="html">&lt;p&gt;Changed PYTHONPATH to point to root of the directory instead of src/ directory - See discussion page for reason&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 00:44, 15 January 2013&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 19:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 19:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* install ''git'' with: '''sudo apt-get install git'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* install ''git'' with: '''sudo apt-get install git'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* download the API with: '''git clone https://github.com/quick2wire/quick2wire-python-api.git'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* download the API with: '''git clone https://github.com/quick2wire/quick2wire-python-api.git'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* enable Python to access the API by adding '''export PYTHONPATH=$PYTHONPATH:$HOME/quick2wire-python-api&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;/src&lt;/del&gt;''' to the end of ''~/.profile''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* enable Python to access the API by adding '''export PYTHONPATH=$PYTHONPATH:$HOME/quick2wire-python-api''' to the end of ''~/.profile''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# Reboot to enable all the above changes&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# Reboot to enable all the above changes&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* '''sudo reboot'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* '''sudo reboot'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key elinux:diff:version:1.11a:oldid:197816:newid:211076 --&gt;
&lt;/table&gt;</summary>
		<author><name>Bgirardot</name></author>	</entry>

	<entry>
		<id>http://elinux.org/index.php?title=RPi_ADC_I2C_Python&amp;diff=197816&amp;oldid=prev</id>
		<title>AndrewS: updated distro note</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=RPi_ADC_I2C_Python&amp;diff=197816&amp;oldid=prev"/>
				<updated>2012-12-06T04:09:47Z</updated>
		
		<summary type="html">&lt;p&gt;updated distro note&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 04:09, 6 December 2012&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 5:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 5:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;I ([[User:AndrewS|AndrewS]]) recently bought a [http://www.abelectronics.co.uk/products/3/Raspberry-Pi/7/ADC-Pi---Raspberry-Pi-Analogue-to-Digital-converter ADC Pi] ('''A'''nalogue to '''D'''igital '''C'''onverter) RaspberryPi addon board from http://www.abelectronics.co.uk/ - there were a few tricky points in getting it working, so I thought I'd write this step-by-step tutorial. The instructions below are all based on the [http://www.raspberrypi.org/downloads 2012-09-18-wheezy-raspbian distro] but should be equally applicable to other distros.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;I ([[User:AndrewS|AndrewS]]) recently bought a [http://www.abelectronics.co.uk/products/3/Raspberry-Pi/7/ADC-Pi---Raspberry-Pi-Analogue-to-Digital-converter ADC Pi] ('''A'''nalogue to '''D'''igital '''C'''onverter) RaspberryPi addon board from http://www.abelectronics.co.uk/ - there were a few tricky points in getting it working, so I thought I'd write this step-by-step tutorial. The instructions below are all based on the [http://www.raspberrypi.org/downloads 2012-09-18-wheezy-raspbian distro] but should be equally applicable to other distros.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;''Update:'' I've just tested the instructions below on a 2012-10-28-wheezy-raspbian distro and they still work fine.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;=== Instructions ===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;=== Instructions ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 36:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 37:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;''8: 0.000000''&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;''8: 0.000000''&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;printed repeatedly to the screen.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;printed repeatedly to the screen.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;You can test that the ADC is working by using e.g. a bent paperclip to connect the &amp;quot;5V&amp;quot; on the board to one of the eight ADC channels, and the corresponding reading on screen should then read approximately 5V (in fact, the voltage output by your PSU).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;You can test that the ADC is working by using e.g. a bent paperclip to connect the &amp;quot;5V&amp;quot; on the board to one of the eight ADC channels, and the corresponding reading on screen should then read approximately 5V (in fact, the voltage output by your PSU)&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;. Stop the script with the usual Ctrl+C&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Back to the [[R-Pi Hub|Hub]], or the [[RPi Tutorials|Tutorials]] page.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Back to the [[R-Pi Hub|Hub]], or the [[RPi Tutorials|Tutorials]] page.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key elinux:diff:version:1.11a:oldid:173042:newid:197816 --&gt;
&lt;/table&gt;</summary>
		<author><name>AndrewS</name></author>	</entry>

	<entry>
		<id>http://elinux.org/index.php?title=RPi_ADC_I2C_Python&amp;diff=173042&amp;oldid=prev</id>
		<title>AndrewS: /* Reading ADC values over I2C using Python */</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=RPi_ADC_I2C_Python&amp;diff=173042&amp;oldid=prev"/>
				<updated>2012-09-24T14:04:53Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Reading ADC values over I2C using Python&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 14:04, 24 September 2012&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== Reading ADC values over I2C using Python ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== Reading ADC values over I2C using Python ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;I ([[User:AndrewS|AndrewS]]) recently bought a [http://www.abelectronics.co.uk/products/3/Raspberry-Pi/7/ADC-Pi---Raspberry-Pi-Analogue-to-Digital-converter ADC Pi] RaspberryPi addon board from http://www.abelectronics.co.uk/ - there were a few tricky points in getting it working, so I thought I'd write this step-by-step tutorial. The instructions below are all based on the [http://www.raspberrypi.org/downloads 2012-09-18-wheezy-raspbian distro] but should be equally applicable to other distros.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;I ([[User:AndrewS|AndrewS]]) recently bought a [http://www.abelectronics.co.uk/products/3/Raspberry-Pi/7/ADC-Pi---Raspberry-Pi-Analogue-to-Digital-converter ADC Pi] &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;('''A'''nalogue to '''D'''igital '''C'''onverter) &lt;/ins&gt;RaspberryPi addon board from http://www.abelectronics.co.uk/ - there were a few tricky points in getting it working, so I thought I'd write this step-by-step tutorial. The instructions below are all based on the [http://www.raspberrypi.org/downloads 2012-09-18-wheezy-raspbian distro] but should be equally applicable to other distros.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;=== Instructions ===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;=== Instructions ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* add '''i2c-dev''' to the end of ''/etc/modules''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* add '''i2c-dev''' to the end of ''/etc/modules''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* comment out (with a '''#''') the line that says '''blacklist i2c-bcm2708''' in ''/etc/modprobe.d/raspi-blacklist.conf''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* comment out (with a '''#''') the line that says '''blacklist i2c-bcm2708''' in ''/etc/modprobe.d/raspi-blacklist.conf''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# Enable the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;pi &lt;/del&gt;user to access I2C hardware&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# Enable the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;current &lt;/ins&gt;user to access I2C hardware&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* install i2c-tools (includes ''i2cdetect'' and adds the ''i2c'' group) with: '''sudo apt-get update &amp;amp;&amp;amp; sudo apt-get install i2c-tools'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* install i2c-tools (includes ''i2cdetect'' and adds the ''i2c'' group) with: '''sudo apt-get update &amp;amp;&amp;amp; sudo apt-get install i2c-tools'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* add the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;''pi'' &lt;/del&gt;user to the ''i2c'' group with: '''sudo adduser $USER i2c'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* add the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;current &lt;/ins&gt;user to the ''i2c'' group with: '''sudo adduser $USER i2c'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# Install the Quick2Wire Python API&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# Install the Quick2Wire Python API&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* install ''git'' with: '''sudo apt-get install git'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* install ''git'' with: '''sudo apt-get install git'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* download the API with: '''git clone https://github.com/quick2wire/quick2wire-python-api.git'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* download the API with: '''git clone https://github.com/quick2wire/quick2wire-python-api.git'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* enable Python to access the API by adding '''export PYTHONPATH=$PYTHONPATH:$HOME/quick2wire-python-api/src''' to the end of ''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;/home/pi&lt;/del&gt;/.profile''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* enable Python to access the API by adding '''export PYTHONPATH=$PYTHONPATH:$HOME/quick2wire-python-api/src''' to the end of ''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;~&lt;/ins&gt;/.profile''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# Reboot to enable all the above changes&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# Reboot to enable all the above changes&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* '''sudo reboot'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* '''sudo reboot'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>AndrewS</name></author>	</entry>

	<entry>
		<id>http://elinux.org/index.php?title=RPi_ADC_I2C_Python&amp;diff=173030&amp;oldid=prev</id>
		<title>AndrewS: Added links back to Tutorials page</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=RPi_ADC_I2C_Python&amp;diff=173030&amp;oldid=prev"/>
				<updated>2012-09-24T13:57:36Z</updated>
		
		<summary type="html">&lt;p&gt;Added links back to Tutorials page&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 13:57, 24 September 2012&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[[Category:RaspberryPi]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Back to the [[R-Pi Hub|Hub]], or the [[RPi Tutorials|Tutorials]] page. &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== Reading ADC values over I2C using Python ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== Reading ADC values over I2C using Python ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 34:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 37:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;printed repeatedly to the screen.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;printed repeatedly to the screen.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;You can test that the ADC is working by using e.g. a bent paperclip to connect the &amp;quot;5V&amp;quot; on the board to one of the eight ADC channels, and the corresponding reading on screen should then read approximately 5V (in fact, the voltage output by your PSU).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;You can test that the ADC is working by using e.g. a bent paperclip to connect the &amp;quot;5V&amp;quot; on the board to one of the eight ADC channels, and the corresponding reading on screen should then read approximately 5V (in fact, the voltage output by your PSU).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Back to the [[R-Pi Hub|Hub]], or the [[RPi Tutorials|Tutorials]] page.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>AndrewS</name></author>	</entry>

	<entry>
		<id>http://elinux.org/index.php?title=RPi_ADC_I2C_Python&amp;diff=172556&amp;oldid=prev</id>
		<title>AndrewS: Created page with &quot;== Reading ADC values over I2C using Python ==  I (AndrewS) recently bought a [http://www.abelectronics.co.uk/products/3/Raspberry-Pi/7/ADC-Pi---Raspberry-Pi-Ana...&quot;</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=RPi_ADC_I2C_Python&amp;diff=172556&amp;oldid=prev"/>
				<updated>2012-09-23T22:16:22Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Reading ADC values over I2C using Python ==  I (&lt;a href=&quot;/User:AndrewS&quot; title=&quot;User:AndrewS&quot;&gt;AndrewS&lt;/a&gt;) recently bought a [http://www.abelectronics.co.uk/products/3/Raspberry-Pi/7/ADC-Pi---Raspberry-Pi-Ana...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Reading ADC values over I2C using Python ==&lt;br /&gt;
&lt;br /&gt;
I ([[User:AndrewS|AndrewS]]) recently bought a [http://www.abelectronics.co.uk/products/3/Raspberry-Pi/7/ADC-Pi---Raspberry-Pi-Analogue-to-Digital-converter ADC Pi] RaspberryPi addon board from http://www.abelectronics.co.uk/ - there were a few tricky points in getting it working, so I thought I'd write this step-by-step tutorial. The instructions below are all based on the [http://www.raspberrypi.org/downloads 2012-09-18-wheezy-raspbian distro] but should be equally applicable to other distros.&lt;br /&gt;
&lt;br /&gt;
=== Instructions ===&lt;br /&gt;
Files in the ''/etc'' directory below need to be edited as root, so use '''sudo nano ''filename'' '''&lt;br /&gt;
&lt;br /&gt;
# Enable I2C support&lt;br /&gt;
#* add '''i2c-dev''' to the end of ''/etc/modules''&lt;br /&gt;
#* comment out (with a '''#''') the line that says '''blacklist i2c-bcm2708''' in ''/etc/modprobe.d/raspi-blacklist.conf''&lt;br /&gt;
# Enable the pi user to access I2C hardware&lt;br /&gt;
#* install i2c-tools (includes ''i2cdetect'' and adds the ''i2c'' group) with: '''sudo apt-get update &amp;amp;&amp;amp; sudo apt-get install i2c-tools'''&lt;br /&gt;
#* add the ''pi'' user to the ''i2c'' group with: '''sudo adduser $USER i2c'''&lt;br /&gt;
# Install the Quick2Wire Python API&lt;br /&gt;
#* install ''git'' with: '''sudo apt-get install git'''&lt;br /&gt;
#* download the API with: '''git clone https://github.com/quick2wire/quick2wire-python-api.git'''&lt;br /&gt;
#* enable Python to access the API by adding '''export PYTHONPATH=$PYTHONPATH:$HOME/quick2wire-python-api/src''' to the end of ''/home/pi/.profile''&lt;br /&gt;
# Reboot to enable all the above changes&lt;br /&gt;
#* '''sudo reboot'''&lt;br /&gt;
# Download and run the demo script&lt;br /&gt;
#* download it with: '''wget http://www.andrewscheller.co.uk/adc_demo.py'''&lt;br /&gt;
#* make it executable with: '''chmod +x adc_demo.py'''&lt;br /&gt;
#* run it with: '''./adc_demo.py'''&lt;br /&gt;
&lt;br /&gt;
If everything went well you should now find that you get:&amp;lt;br&amp;gt;&lt;br /&gt;
''1: 0.000000''&amp;lt;br&amp;gt;&lt;br /&gt;
''2: 0.000000''&amp;lt;br&amp;gt;&lt;br /&gt;
''3: 0.000000''&amp;lt;br&amp;gt;&lt;br /&gt;
''4: 0.000000''&amp;lt;br&amp;gt;&lt;br /&gt;
''5: 0.000000''&amp;lt;br&amp;gt;&lt;br /&gt;
''6: 0.000000''&amp;lt;br&amp;gt;&lt;br /&gt;
''7: 0.000000''&amp;lt;br&amp;gt;&lt;br /&gt;
''8: 0.000000''&amp;lt;br&amp;gt;&lt;br /&gt;
printed repeatedly to the screen.&lt;br /&gt;
You can test that the ADC is working by using e.g. a bent paperclip to connect the &amp;quot;5V&amp;quot; on the board to one of the eight ADC channels, and the corresponding reading on screen should then read approximately 5V (in fact, the voltage output by your PSU).&lt;/div&gt;</summary>
		<author><name>AndrewS</name></author>	</entry>

	</feed>