|1||First install the i2c-tools:
apt-get install i2c-tools
|2||Next SPI and I2C is blacklisted from modprobe by default. Edit /etc/modprobe.d/raspi-blacklist.conf with vi or nano and comment out (place # as first character on line):
|3||To insure modules are loaded at boot add the following lines to /etc/modules:
If you are going to access the I2C from users other then root create a file called /etc/udev/rules.d/99-i2c.rules with the following line:
This will allow access from every user. To allow access only from a specific group:
SUBSYSTEM=="i2c-dev", GROUP="input", MODE="0666"
|5||Reboot the pi by issuing:
|6||Verify device files are available:
If you are using I2C with Python, you will need the smbus python library as it is not installed by default:
apt-get install python-smbus
|8||Once you have the I2C device attached, you can determine the address by running:
i2cdetect -y <port>
Replace <port> with 0 for the first version of the Raspberry Pi board and 1 for the second.