一、目的
这一节我们学习如何使用乐鑫的ESP32开发板连接LM75 温度模块,温度相关的操作。
在早前我们也介绍过其他温度传感器的模块的操作,这里我们来学习新的模块LM75 温度传感器,它精度高。
二、环境
ESP32(固件:esp32-20220618-v1.19.1.bin) + Thonny(V4.0.1) + LM75 温度传感器模块 + ILI9341屏幕 + Win10 64位商业版
ILI9341屏幕接线方法,以及屏幕驱动和相关字库,请看这个文章哈:
三、LM75温度传感器驱动
lm75a.py
"""
MicroPython LM75A Digital Temperature Sensor
https://github.com/mcauser/micropython-lm75a
MIT License
Copyright (c) 2019 Mike Causer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMIT