# Modify the configuration file
Raspberry Pi has integrated the I2C driver and only needs to be started.
Modify configuration file
Sudo nano/etc/modprobe. d/raspi-blacklist.conf
! [Configure] (http://images.cnblogs.com/cnblogs_com/hangxin1940/466697/o_rasp_i2c1.png "comment the third line ")
Comment out the third line, CTRL + x save
Next, start the I2C module.
Sudo nano/etc/modules
! [Configure] (http://images.cnblogs.com/cnblogs_com/hangxin1940/466697/o_rasp_i2c2.png "add a line ")
Add a line 'i2c-dev'
# Installation Tools
Sudo apt-Get install i2c-tools Python-SMBus
Add the 'Pi 'user to the 'i2c' group
Sudo adduser PI I2C
Restart
Sudo shutdown-R now
# Test I2C
Connect to the I2C device and run the following command:
Raspberry Pi:
Sudo i2cdetect-Y 0
Raspberry Pi Type B:
Sudo i2cdetect-Y 1
The I2C address is displayed.
! [Configure] (http://images.cnblogs.com/cnblogs_com/hangxin1940/466697/o_rasp_i2c3.png "add a line ")
* I have GY-85 9-Axis Module attached to I2C, a total of 3 sensors itg3205 + adxl345 + hmc5883l *