1 Star 0 Fork 0

OSCHINA-MIRROR/FArduino-DHT_lib

Join Gitlife
Discover and participate in excellent open source projects with over 10 million developers. Private repositories are also completely free :)
Join for free
This repository does not have a declared open-source license file (LICENSE). Please refer to the specific project description and its code upstream dependencies when using.
Clone/Download
Contribute code
Sync code
Cancel
Hint: Since Git does not support empty folders, creating a folder will generate an empty .keep file.
Loading...
README.md

DHT_lib

DHT Temperature & Humidity Sensor library for Arduino

#include <Arduino.h>
#include <DHT.h>

#define DHT_DATA_pin 8

DHT dht;

void setup() {
	Serial.begin(115200);

	// load DHT Data pin
	dht.load(DHT_DATA_pin);

	//取一次
	String result=dht.get();
	Serial.println(result);

	//取温湿度数值
	double d_temp,d_hum;
	dht.get(d_temp,d_hum);
	Serial.println(d_temp);
	Serial.println(d_hum);

	//取平均

	String Data="";
	//取3次平均值,每次间隔3000ms
	Data=dht.get_a(3,3000);
	//如果需要单独取数值
	dht.get_a(d_temp,d_hum,3,3000);
	Serial.println(d_temp);
	Serial.println(d_hum);
	Serial.println(Data);


}

Comments ( 0 )

You can comment after Login

Introduction

Библиотека датчика температуры и влажности DHT для Arduino. Expand Collapse
Cancel

Releases

No releases yet

Contributor

All

Recent Activities

Load more
No more results to load
1
https://gitlife.ru/oschina-mirror/FArduino-DHT_lib.git
git@gitlife.ru:oschina-mirror/FArduino-DHT_lib.git
oschina-mirror
FArduino-DHT_lib
FArduino-DHT_lib
master