MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / read

Method read

libraries/DHT20/DHT20.cpp:90–111  ·  view source on GitHub ↗

/////////////////////////////////////////// READ THE SENSOR

Source from the content-addressed store, hash-verified

88// READ THE SENSOR
89//
90int DHT20::read()
91{
92 // do not read to fast
93 if (millis() - _lastRead < 1000)
94 {
95 return DHT20_ERROR_LASTREAD;
96 }
97
98 int status = requestData();
99 if (status < 0) return status;
100 // wait for measurement ready
101 while (isMeasuring())
102 {
103 yield();
104 }
105 // read the measurement
106 status = readData();
107 if (status < 0) return status;
108
109 // convert it to meaningful data
110 return convert();
111}
112
113
114int DHT20::requestData()

Callers 4

readDataMethod · 0.45
readStatusMethod · 0.45
_resetRegisterMethod · 0.45
unittestFunction · 0.45

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.36