使用iic方式获取信号没有打开iic设置,树莓派报错:

Process Process-3:
Traceback (most recent call last):
  File "/usr/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
    self.run()
  File "/usr/lib/python3.7/multiprocessing/process.py", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "main.py", line 60, in display_temp_mat
    i2c = busio.I2C(board.SCL, board.SDA)
  File "/usr/local/lib/python3.7/dist-packages/busio.py", line 35, in __init__
    self.init(scl, sda, frequency)
  File "/usr/local/lib/python3.7/dist-packages/busio.py", line 159, in init
    (scl, sda), i2cPorts
ValueError: No Hardware I2C on (scl,sda)=(3, 2)
Valid I2C ports: ((1, 3, 2), (0, 1, 0), (10, 45, 44))
WARNING:tensorflow:From /usr/local/lib/python3.7/dist-packages/keras/backend/tensorflow_backend.py:4479: The name tf.truncated_normal is deprecated. Please use tf.random.truncated_normal instead.

解决办法:

sudo raspi-config

进入设置扎、找到i2c设置打开即可

你可能感兴趣的:(树莓派,iic,树莓派i2c)