Raspberry PI2 and both i2c busses 打开RaspberryPi2的第二个i2c口 (i2c-0)

开启第一个:http://www.raspberrypi-spy.co.uk/2014/11/enabling-the-i2c-interface-on-the-raspberry-pi/


第二个:

I’m working on a project that uses devices that have overlapping i2c addresses. In more recent raspberry pi instances they changed how this works and there is quite a bit of confusion on forums about how to do this. Here’s your 2015 update for using NOOBS as a starting point:

Add these two lines to /boot/config.txt:

echo dtparam=i2c_arm=on >> /boot/config.txt
echo dtparam=i2c_vc=on >> /boot/config.txt

append bcm2708.vc_i2c_override=1 to /boot/cmdline.txt

WIth this, you can use both i2c, pins 3,5 and 27,28. Keep in mind you may need a pull-up for pins 27,28 and your i2c setup, where 3,5 have them on-board.

root@raspberrypi:/home/pi# i2cdetect -l
i2c-0    i2c           3f205000.i2c                        I2C adapter
i2c-1    i2c           3f804000.i2c                        I2C adapter

root@raspberrypi:/home/pi# ls -ld /dev/i2c*
crw-rw—T 1 root i2c 89, 0 May 27 01:08 /dev/i2c-0
crw-rw—T 1 root i2c 89, 1 May 27 01:08 /dev/i2c-1


重启就可以看到了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值