MCPcopy Create free account
hub / github.com/adafruit/DHT-sensor-library / DHT

Method DHT

DHT.cpp:42–55  ·  view source on GitHub ↗

! * @brief Instantiates a new DHT class * @param pin * pin number that sensor is connected * @param type * type of sensor * @param count * number of sensors */

Source from the content-addressed store, hash-verified

40 * number of sensors
41 */
42DHT::DHT(uint8_t pin, uint8_t type, uint8_t count) {
43 (void)count; // Workaround to avoid compiler warning.
44 _pin = pin;
45 _type = type;
46#ifdef __AVR
47 _bit = digitalPinToBitMask(pin);
48 _port = digitalPinToPort(pin);
49#endif
50 _maxcycles =
51 microsecondsToClockCycles(1000); // 1 millisecond timeout for
52 // reading pulses from DHT sensor.
53 // Note that count is now ignored as the DHT reading algorithm adjusts itself
54 // based on the speed of the processor.
55}
56
57/*!
58 * @brief Setup sensor pins and set pull timings

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected