Difference between revisions of "I2C Setup"
From SingletonMillerWiki
(Created page with "Category:RaspberryTortoise Category:RaspberryPi") |
(→Installation) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[Category:RaspberryTortoise]] [[Category:RaspberryPi]] | [[Category:RaspberryTortoise]] [[Category:RaspberryPi]] | ||
+ | Instructions for setting up and using the I2C interface on the Raspberry Pi. | ||
+ | |||
+ | |||
+ | == Installation == | ||
+ | Add the I2C drivers to the Linux Kernel. | ||
+ | <pre> | ||
+ | sudo modprobe i2c-dev | ||
+ | sudo modprobe i2c-bcm2708 | ||
+ | </pre> | ||
+ | Once the drivers have been added to the Kernel the I2C will appear as <code>/dev/i2c-0</code> and <code>/dev/i2c-1</code>. | ||
+ | |||
+ | To load the drivers every boot add it to config file <code>/etc/modules</code> | ||
+ | |||
+ | <pre>sudo nano /etc/modules</pre> | ||
+ | |||
+ | add <code>i2c-dev</code> and <code>i2c-bcm2708</code> to the end of the file. | ||
+ | |||
+ | The drivers will be loaded at boot time. | ||
+ | |||
+ | Download and install the i2c tools. This is not essential but it is useful for testing I2C devices from the command prompt. | ||
+ | <pre> | ||
+ | sudo apt-get install i2c-tools | ||
+ | </pre> | ||
+ | |||
+ | == Notes == | ||
+ | This setup process has been tested on the following Raspberry Pi linux distributions | ||
+ | * Raspbian Wheezy 2012-08-16 | ||
+ | |||
+ | == Links == | ||
+ | [http://www.lm-sensors.org/wiki/i2cToolsDocumentation i2c Tools] |
Latest revision as of 11:19, 24 August 2012
Instructions for setting up and using the I2C interface on the Raspberry Pi.
Installation
Add the I2C drivers to the Linux Kernel.
sudo modprobe i2c-dev sudo modprobe i2c-bcm2708
Once the drivers have been added to the Kernel the I2C will appear as /dev/i2c-0
and /dev/i2c-1
.
To load the drivers every boot add it to config file /etc/modules
sudo nano /etc/modules
add i2c-dev
and i2c-bcm2708
to the end of the file.
The drivers will be loaded at boot time.
Download and install the i2c tools. This is not essential but it is useful for testing I2C devices from the command prompt.
sudo apt-get install i2c-tools
Notes
This setup process has been tested on the following Raspberry Pi linux distributions
- Raspbian Wheezy 2012-08-16