Access the I2C interface from Ubuntu Terminal.
Connections
I2C ASensor SCL
<-> I2C_SCK_A (PIN 22)
Sensor SDA
<-> I2C_SDA_A (PIN 23)
Sensor GND
<-> GND
Sensor VCC
<-> 5V or 3.3V
//depends on your sensor
I2C BSensor SCL
<-> I2C_SCK_B (PIN 25)
Sensor SDA
<-> I2C_SDA_B (PIN 26)
Sensor GND
<-> GND
Sensor VCC
<-> 5V or 3.3V
//depends on your sensor
I2C ASensor SCL
<-> I2C_SCK_A (PIN 22)
Sensor SDA
<-> I2C_SDA_A (PIN 23)
Sensor GND
<-> GND
Sensor VCC
<-> 5V or 3.3V
//depends on your sensor
I2C BSensor SCL
<-> I2C_SCK_B (PIN 25)
Sensor SDA
<-> I2C_SDA_B (PIN 26)
Sensor GND
<-> GND
Sensor VCC
<-> 5V or 3.3V
//depends on your sensor
I2C 3Sensor SCL
<-> I2C0_SCK (PIN 22)
Sensor SDA
<-> I2C0_SDA (PIN 23)
Sensor GND
<-> GND
Sensor VCC
<-> 5V or 3.3V
//depends on your sensor
I2C 4Sensor SCL
<-> I2C1_SCK (PIN 25)
Sensor SDA
<-> I2C1_SDA (PIN 26)
Sensor GND
<-> GND
Sensor VCC
<-> 5V or 3.3V
//depends on your sensor
I2C ASensor SCL
<-> I2CA_SCK (PIN 25)
Sensor SDA
<-> I2CA_SDA (PIN 26)
Sensor GND
<-> GND
Sensor VCC
<-> 5V or 3.3V
//depends on your sensor
I2C FSensor SCL
<-> I2CF_SCK (PIN 22)
Sensor SDA
<-> I2CF_SDA (PIN 23)
Sensor GND
<-> GND
Sensor VCC
<-> 5V or 3.3V
//depends on your sensor
Device Detection
Detect device on I2C A
:
1 | sudo i2cdetect -y -r 1 |
Detect device on I2C B
:
1 | sudo i2cdetect -y -r 2 |
Detect device on I2C A
:
1 | sudo i2cdetect -y -r 1 |
Detect device on I2C B
:
1 | sudo i2cdetect -y -r 2 |
Detect device on I2C 3
:
1 | sudo i2cdetect -y -r 3 |
Detect device on I2C 4
:
1 | sudo i2cdetect -y -r 4 |
Detect device on I2C A
:
1 | sudo i2cdetect -r -y 0 |
Detect device on I2C F
:
1 | sudo i2cdetect -r -y 5 |
If you have made a connection, you will see the device address, e.g: 0x1d
,0x18
and 0x51
.
Read Registers from Device
Read register 0x0d
of device 0x1d
on I2C A
.
1 | sudo i2cget -f -y 1 0x1d 0x0d |
For more information, please refer to the help messages.