diff --git a/html/_d_h_t_8h.html b/html/_d_h_t_8h.html index cd42721..129f10a 100644 --- a/html/_d_h_t_8h.html +++ b/html/_d_h_t_8h.html @@ -96,8 +96,6 @@ Macros   #define AM2301   21   -#define microsecondsToClockCycles(a)   ((a) * (SystemCoreClock / 1000000L)) - 

Detailed Description

This is a library for DHT series of low cost temperature/humidity sensors.

@@ -232,25 +230,6 @@ Macros

AM2301

-
- - -

◆ microsecondsToClockCycles

- -
-
- - - - - - - - -
#define microsecondsToClockCycles( a)   ((a) * (SystemCoreClock / 1000000L))
-
-

As of 7 Sep 2020 the Arduino Nano 33 BLE boards do not have microsecondsToClockCycles defined.

-
diff --git a/html/_d_h_t_8h_source.html b/html/_d_h_t_8h_source.html index deb8c4c..90b121a 100644 --- a/html/_d_h_t_8h_source.html +++ b/html/_d_h_t_8h_source.html @@ -62,7 +62,7 @@ $(function() {
DHT.h
-Go to the documentation of this file.
1 
18 #ifndef DHT_H
19 #define DHT_H
20 
21 #include "Arduino.h"
22 
23 /* Uncomment to enable printing out nice debug messages. */
24 //#define DHT_DEBUG
25 
26 #define DEBUG_PRINTER \
27  Serial
30 /* Setup debug printing macros. */
31 #ifdef DHT_DEBUG
32 #define DEBUG_PRINT(...) \
33  { DEBUG_PRINTER.print(__VA_ARGS__); }
34 #define DEBUG_PRINTLN(...) \
35  { DEBUG_PRINTER.println(__VA_ARGS__); }
36 #else
37 #define DEBUG_PRINT(...) \
38  {}
39 #define DEBUG_PRINTLN(...) \
40  {}
41 #endif
42 
43 /* Define types of sensors. */
44 #define DHT11 11
45 #define DHT12 12
46 #define DHT22 22
47 #define DHT21 21
48 #define AM2301 21
50 #if (TARGET_NAME == ARDUINO_NANO33BLE)
51 #ifndef microsecondsToClockCycles
52 
56 #define microsecondsToClockCycles(a) ((a) * (SystemCoreClock / 1000000L))
57 #endif
58 #endif
59 
63 class DHT {
64 public:
65  DHT(uint8_t pin, uint8_t type, uint8_t count = 6);
66  void begin(uint8_t usec = 55);
67  float readTemperature(bool S = false, bool force = false);
68  float convertCtoF(float);
69  float convertFtoC(float);
70  float computeHeatIndex(bool isFahrenheit = true);
71  float computeHeatIndex(float temperature, float percentHumidity,
72  bool isFahrenheit = true);
73  float readHumidity(bool force = false);
74  bool read(bool force = false);
75 
76 private:
77  uint8_t data[5];
78  uint8_t _pin, _type;
79 #ifdef __AVR
80  // Use direct GPIO access on an 8-bit AVR so keep track of the port and
81  // bitmask for the digital pin connected to the DHT. Other platforms will use
82  // digitalRead.
83  uint8_t _bit, _port;
84 #endif
85  uint32_t _lastreadtime, _maxcycles;
86  bool _lastresult;
87  uint8_t pullTime; // Time (in usec) to pull up data line before reading
88 
89  uint32_t expectPulse(bool level);
90 };
91 
95 class InterruptLock {
96 public:
97  InterruptLock() {
98 #if !defined(ARDUINO_ARCH_NRF52)
99  noInterrupts();
100 #endif
101  }
102  ~InterruptLock() {
103 #if !defined(ARDUINO_ARCH_NRF52)
104  interrupts();
105 #endif
106  }
107 };
108 
109 #endif
float convertCtoF(float)
Converts Celcius to Fahrenheit.
Definition: DHT.cpp:133
+Go to the documentation of this file.
1 
18 #ifndef DHT_H
19 #define DHT_H
20 
21 #include "Arduino.h"
22 
23 /* Uncomment to enable printing out nice debug messages. */
24 //#define DHT_DEBUG
25 
26 #define DEBUG_PRINTER \
27  Serial
30 /* Setup debug printing macros. */
31 #ifdef DHT_DEBUG
32 #define DEBUG_PRINT(...) \
33  { DEBUG_PRINTER.print(__VA_ARGS__); }
34 #define DEBUG_PRINTLN(...) \
35  { DEBUG_PRINTER.println(__VA_ARGS__); }
36 #else
37 #define DEBUG_PRINT(...) \
38  {}
39 #define DEBUG_PRINTLN(...) \
40  {}
41 #endif
42 
43 /* Define types of sensors. */
44 #define DHT11 11
45 #define DHT12 12
46 #define DHT22 22
47 #define DHT21 21
48 #define AM2301 21
50 #if defined(TARGET_NAME) && (TARGET_NAME == ARDUINO_NANO33BLE)
51 #ifndef microsecondsToClockCycles
52 
56 #define microsecondsToClockCycles(a) ((a) * (SystemCoreClock / 1000000L))
57 #endif
58 #endif
59 
63 class DHT {
64 public:
65  DHT(uint8_t pin, uint8_t type, uint8_t count = 6);
66  void begin(uint8_t usec = 55);
67  float readTemperature(bool S = false, bool force = false);
68  float convertCtoF(float);
69  float convertFtoC(float);
70  float computeHeatIndex(bool isFahrenheit = true);
71  float computeHeatIndex(float temperature, float percentHumidity,
72  bool isFahrenheit = true);
73  float readHumidity(bool force = false);
74  bool read(bool force = false);
75 
76 private:
77  uint8_t data[5];
78  uint8_t _pin, _type;
79 #ifdef __AVR
80  // Use direct GPIO access on an 8-bit AVR so keep track of the port and
81  // bitmask for the digital pin connected to the DHT. Other platforms will use
82  // digitalRead.
83  uint8_t _bit, _port;
84 #endif
85  uint32_t _lastreadtime, _maxcycles;
86  bool _lastresult;
87  uint8_t pullTime; // Time (in usec) to pull up data line before reading
88 
89  uint32_t expectPulse(bool level);
90 };
91 
95 class InterruptLock {
96 public:
97  InterruptLock() {
98 #if !defined(ARDUINO_ARCH_NRF52)
99  noInterrupts();
100 #endif
101  }
102  ~InterruptLock() {
103 #if !defined(ARDUINO_ARCH_NRF52)
104  interrupts();
105 #endif
106  }
107 };
108 
109 #endif
float convertCtoF(float)
Converts Celcius to Fahrenheit.
Definition: DHT.cpp:133
DHT(uint8_t pin, uint8_t type, uint8_t count=6)
Instantiates a new DHT class.
Definition: DHT.cpp:43
float convertFtoC(float)
Converts Fahrenheit to Celcius.
Definition: DHT.cpp:141
bool read(bool force=false)
Read value from sensor or return last one from less than two seconds.
Definition: DHT.cpp:232
diff --git a/html/globals.html b/html/globals.html index bcdcf07..a60456d 100644 --- a/html/globals.html +++ b/html/globals.html @@ -86,9 +86,6 @@ $(function() {
  • DHT_SENSOR_VERSION : DHT_U.h
  • -
  • microsecondsToClockCycles -: DHT.h -
  • MIN_INTERVAL : DHT.cpp
  • diff --git a/html/globals_defs.html b/html/globals_defs.html index 2e01711..1fc50f9 100644 --- a/html/globals_defs.html +++ b/html/globals_defs.html @@ -86,9 +86,6 @@ $(function() {
  • DHT_SENSOR_VERSION : DHT_U.h
  • -
  • microsecondsToClockCycles -: DHT.h -
  • MIN_INTERVAL : DHT.cpp
  • diff --git a/html/search/all_7.js b/html/search/all_7.js index d029170..9bc38bc 100644 --- a/html/search/all_7.js +++ b/html/search/all_7.js @@ -1,5 +1,4 @@ var searchData= [ - ['microsecondstoclockcycles',['microsecondsToClockCycles',['../_d_h_t_8h.html#aa4a5bbc71d71ab25856c1366b6ca15bb',1,'DHT.h']]], ['min_5finterval',['MIN_INTERVAL',['../_d_h_t_8cpp.html#ae5d44a5fa9fd9d113f6bff639f06ddd6',1,'DHT.cpp']]] ]; diff --git a/html/search/defines_2.js b/html/search/defines_2.js index d029170..9bc38bc 100644 --- a/html/search/defines_2.js +++ b/html/search/defines_2.js @@ -1,5 +1,4 @@ var searchData= [ - ['microsecondstoclockcycles',['microsecondsToClockCycles',['../_d_h_t_8h.html#aa4a5bbc71d71ab25856c1366b6ca15bb',1,'DHT.h']]], ['min_5finterval',['MIN_INTERVAL',['../_d_h_t_8cpp.html#ae5d44a5fa9fd9d113f6bff639f06ddd6',1,'DHT.cpp']]] ];