you can configure DHT type

This commit is contained in:
Mathieu Maret 2016-07-09 14:35:55 +02:00
parent a68a207fa1
commit d3d7e0318a
2 changed files with 5 additions and 1 deletions

View File

@ -50,3 +50,7 @@
#ifndef CONFIG_SETUP_GPIO #ifndef CONFIG_SETUP_GPIO
#define CONFIG_SETUP_GPIO 3 #define CONFIG_SETUP_GPIO 3
#endif #endif
#ifndef CONFIG_DHT_TYPE
#define CONFIG_DHT_TYPE DHT11
#endif

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#ifdef CONFIG_ENABLE_DHT #ifdef CONFIG_ENABLE_DHT
#include <DHT.h> #include <DHT.h>
#define DHTTYPE DHT11 #define DHTTYPE CONFIG_DHT_TYPE
DHT *dht = NULL; DHT *dht = NULL;
int DHTSetup(int pin); int DHTSetup(int pin);
int DHTGetTempAndHumidity(float &t, float &h); int DHTGetTempAndHumidity(float &t, float &h);