In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "raspberry pie how to achieve temperature and humidity sensor DHT11", the content is easy to understand, clear, hope to help you solve your doubts, let the editor lead you to study and learn how to achieve temperature and humidity sensor DHT11 "this article.
1. Connect the line
I bought this DHT11 is rather depressed, three pins, did not indicate which is VCC, which is GND, searched a bunch on the Internet, marked for other sensors are clearly marked, mine only marked a plus or minus sign, and then consulted with a treasure boss, confirmed that it is + is VCC,- is GND, the middle is Data (maybe because I am a rookie in telecommunications, do not understand these jargon)
1-> 3.3v connect the first GPIO pin on the left
2-> GPIO data interface, you can connect one GPIO pin at will (the seventh pin corresponds to GPIO Pin # 4, corresponding to the following code)
3-> GND ground (6th pin or other GND)
2. Install the gpio driver (let's call it the driver, the principle is not clear)
Sudo apt-get install wiringpi
3. Run the example (C code)
# include # define MAX_TIME 100#define DHT11PIN 7 / / read data pin # define ATTEMPTS 5 / / retry 5 times when no responseint dht11_val [5] = {0meme0 0re0re0}; int dht11_read_val () {uint8_t lststate=HIGH; / / last state uint8_t counter=0; uint8_t jigsaw 0PowerI; for
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.