转自:https://www.raspberrypi-spy.co.uk/2014/08/enabling-the-spi-interface-on-the-raspberry-pi/
方案一:图形界面
Menu > Preferences > Raspberry Pi Configuration
方案二:终端
sudo raspi-config
方案三:修改文件(需重启)
引导根目录下:
config.txt
文本打开底部添加:
dtparam=spi=on
修正:上述方法不行
同打开文件config.txt
行45,如下:
# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on
修改为:
# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
dtparam=spi=on
想必你一眼就看懂了(自己当时真是傻,马马虎虎看config.txt)