树莓派系统包含了18b20的驱动(1-wire interface),我们只需要将其开启即可。有两种开启方式:

方式一:输入raspi-config命令,然后在interfacing options –> 1-wire中设为enable。
方式二:在/boot/config.txt文件中,添加dtoverlay=w1-gpio,gpiopin=4

sudo modprobe w1_gpio

sudo modprobe w1_therm

 

cd /sys/bus/w1/devices/

cd 28-05fsda5f9dsa5f90dsa

cat w1_slave

b3 01 55 05 7f a5 a5 66 d9 : crc=d9 YES
b3 01 55 05 7f a5 a5 66 d9 t=27187

 

相关文章:

  • 2022-12-23
  • 2022-03-01
  • 2022-01-29
  • 2022-02-10
  • 2022-01-06
  • 2021-08-29
  • 2021-11-14
  • 2021-07-24
猜你喜欢
  • 2022-12-23
  • 2021-12-24
  • 2022-02-25
  • 2021-12-15
  • 2021-12-17
  • 2022-02-14
相关资源
相似解决方案