In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of "what is the method of MicroPython controlling DS18B20 temperature detection". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "what is the method of MicroPython controlling DS18B20 temperature detection" can help you solve the problem.
1. Experimental purpose
1. Learn the method of extending the simple Iripple O interface in the PC system.
two。 Further learn the design method of compiling data output program.
3. Learn the wiring method of DS18B20 and use DS18B20 to detect the current temperature.
two。 Required components
1 F407Micropython development board
1 data line
1 DS18b20 temperature sensor
1 DS18B20 temperature measurement module (excluding DS18B20)
Some DuPont lines
Putty debugging tool
3. Learn the wiring method of DS18B20 and detect the current temperature
First take a look at the meaning of DS18B20 pins, as shown in the following figure:
Plug the DS18B20 temperature sensor directly into the DS18B20 module. As shown in the picture
The corresponding relationship between the pins of the DS18B20 expansion board and the F407 Micropython development board is as follows:
F407 Micropython development board DS18B20
-
# 3V3 or any Pin = > VDD
# any Pin = > DO
# GND = > GND
If you still don't understand, just put the pin number on it.
F407 Micropython development board DS18B20
-
3.3v = > VDD
GND = > GND
Y12 = > DO
4. source code
After wiring the ok, copy the ds18b20.py and one_wire.py to the root directory of the PYBFLASH disk. Copy the following code into main.py to save, when the red light is off, rst development board, you can see the current temperature with Putty.
Main.py source code:
# main.pyimport pybfrom pyb import Pinfrom ds18b20 import DS18X20DQ=DS18X20 (Pin ('Y12')) # DQwhile True: tem = DQ.read_temp () print (tem) pyb.delay (1000) on "what is the method of MicroPython controlling DS18B20 temperature detection". Thank you for your reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.