Open main menu

Changes

How to enable I2C

1,646 bytes added, 16:39, 24 July 2023
no edit summary
{{GD Template Impl}}
How to enable I2C funcion on Raspbian:

Please run the following command after you start the Raspberry Pi

sudo raspi-config

Select 5 Interfacing Options and then P5 I2C - Enable/Disable automatic loading. A prompt will appear asking Would you like the ARM I2C interface to be enabled?, select "Yes"

[[File:Rpi-config-1.jpg|none]]

[[File:Rpi-config-5.jpg|none]]

[[File:Rpi-config-6.jpg|none]]

Select "OK"

Select "Finish" to return to the command line and reboot your raspberry pi.
sudo reboot

The Raspberry Pi will reboot and the 'i2c' interface will be enabled.


Then run the following command to check i2c port
sudo i2cdetect -y 1

The following is the I2C address of [[X729]]
<pre>
pi@raspberrypi:~ $ sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- 36 -- -- -- -- -- 3c -- -- --
40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
</pre>
<pre>
#36 - the address of the battery fuel gauging chip
#3c - OLED display
#40 - TI INA219 12-bit current/voltage/power monitor
#68 - the address of the RTC chip
</pre>

PS: Different hardware products may have different I2C addresses

<!--Add review function! -->
<comments />

<!--Please choose the -->
<!--Remove other categories, just keep the appropriate categories -->

[[Category:Raspberry pi]]
[[Category:Knowledge]]