[Circuit] 開啟RASPBERRY PI I2C功能

將/etc/modprobe.d/raspi-blacklist.conf文件中的兩項(xiàng)注釋掉:

pi@raspberrypi ~ $ sudo nano /etc/modprobe.d/raspi-blacklist.conf
#blacklist spi-bcm2708
#blacklist i2c-bcm2708

在/etc/modules中添加以下幾行

pi@raspberrypi ~ $ sudo nano /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.
i2c-dev
i2c-bcm2708
snd-bcm2835

更新軟件列表并安裝i2c-tools和python-smbus

pi@raspberrypi ~ $ sudo apt-get update
pi@raspberrypi ~ $ sudo apt-get install i2c-tools python-smbus

打開raspi-config=>Interfacing Options=>I2C

pi@raspberrypi ~ $ sudo raspi-config

重啟后用以下命令查看i2c設(shè)備(PI B+ "sudo i2cdetect -y 1"; PI A "sudo i2cdetect -y 0")

pi@raspberrypi ~ $ sudo i2cdetect -y 1

樹莓派i2c總線使用 及 i2c-tools python-smbus 的安裝:https://blog.csdn.net/panwen1111/article/details/81044428

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容