Skip to main content
 首页 » 编程设计

python之Raspberry Pi 2之无法启用/dev/i2c-0

2025年05月04日33qq78292959

我在 raspberry pi 2 上遇到问题我已经完成了所有这些步骤:

*sudo nano /etc/modprobe.d/raspi-blacklist.conf  //#blacklist i2c-bcm2708 

*sudo nano/etc/modules//在文件末尾添加行 i2c-dev。 *编辑/boot/cmdline.txt 文件:sudo nano/boot/cmdline.txt//在行尾添加 bcm2708.vc_i2c_override=1 并且当我运行 ls/dev/i2c* 我只得到 /dev/i2c-1. 有什么想法吗?我正在使用 Raspberry pi 2。谢谢

我希望看到 /dev/i2c-1 和 /dev/i2c-0 而不仅仅是 /dev/i2c- 1.

请您参考如下方法:

你必须添加

dtparam=i2c_vc=on 

到

/boot/config.txt 

以nano为例

sudo nano /boot/config.txt 

然后我可以在运行 Debian Wheezy 版本的 Raspberry Pi 2 上看到两个 i2c 接口(interface)。

稍后您可能会遇到检测总线上 i2c 设备的问题。请在 Raspberry Pi 官方论坛上查看此主题以了解后续步骤。 i2c-0 on Raspberry Pi 2 Model B

Those gpios don't have external pull ups to 3V3. They will default to the internal 50k pull-ups to 3V3 but they not be sufficient to drive the bus. I'd try adding a 2k pull up to 3V3 on each pin (i2c-1 has external 1k8 pull-ups to 3V3).