- 红外模块
- 购买地址和文档 https://detail.tmall.com/item.htm?id=525526707341&rn=3a8680a95b09a61a991525bcc91415b8&abbucket=12
- 首先确认是否已经开启了i2c
$ sudo i2cdetect -y 1
- 如果出现以下错误
Error:Could not open file `/dev/i2c-1': No such file or dire
- 那么说明没有开启i2c接口SDA和SCL,开启文档见1, STICKY:I2C, SPI, I2S, LIRC, PPS, stopped working? Read this
- 开启/boot/config.txt如下选项,或者使用raspi-config设置
# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=spi=on
- 接好线,根据模块上的针脚标签以及树莓派针脚指示图对接
- 下载代码,并执行
$ git clone https://github.com/CRImier/python-MLX90614/
$ cd python-MLX90614
$ python example.py