Introduction
I2C is a way for your Raspberry Pi to talk to other small devices like sensors or displays using just two wires.
I2C is a way for your Raspberry Pi to talk to other small devices like sensors or displays using just two wires.
sudo raspi-config
# Navigate to Interface Options > I2C > Enable
sudo rebootsudo raspi-config to open the Raspberry Pi configuration tool.sudo raspi-config # Select 'Interface Options' # Select 'I2C' # Choose 'Yes' to enable sudo reboot
lsmod | grep i2c
# Check if I2C modules are loaded after rebootThis program installs a tool to scan for I2C devices connected to your Raspberry Pi and lists their addresses.
# After enabling I2C and rebooting, check connected I2C devices sudo apt-get install -y i2c-tools sudo i2cdetect -y 1
Make sure your Raspberry Pi is updated before enabling I2C for best results.
Use sudo i2cdetect -y 1 to see if your devices are connected properly.
Be careful with wiring; wrong connections can damage your Raspberry Pi or devices.
Enable I2C using sudo raspi-config under Interface Options.
Reboot your Raspberry Pi after enabling I2C to activate it.
Use i2cdetect to check connected I2C devices.
sudo raspi-config to open the configuration menu.sudo raspi-config and select Interface Options -> Option Asudo raspi-config and select Interface Options [OK]i2cdetect -y 1 where '1' is the bus number.sudo raspi-config, what is the expected output of i2cdetect -y 1 if a device is connected at address 0x40?i2cdetect -y 1 shows no devices. What is a likely cause?i2cdetect -y 1 to /etc/rc.local runs the scan automatically at startup.i2cdetect -y 1 to /etc/rc.local -> Option Ai2cdetect -y 1 to /etc/rc.local [OK]Pass the test and this pattern moves unknown