I'm trying to learn the environment and have come across something that I can't figure out - and is probably very simple.
in the code snippet below (which comes from the DHT.cpp library, there are references to data(2) and data(3). I can't seem to figure out what the code construct refers to. "data" is not a variable, or at least isn't defined in the .h or .cpp. I don't believe this addresses pins 2 and 3, since in the rest of the library the pin number is a parameter. I've searched the Help on environment and language. I've searched the various standard library .h files in case it's something that was defined there. I'm at a loss - can anyone point me to what this references? Thanks,
//boolean S == Scale. True == Farenheit; False == Celcius
float DHT::readTemperature(bool S) {
float f;
if (read()) {
switch (_type) {
case DHT11:
f = data[2];
if(S)
f = convertCtoF(f);
return f;
case DHT22:
case DHT21:
f = data[2] & 0x7F;
f *= 256;
f += data[3];
f /= 10;
if (data[2] & 0x80)
f *= -1;
if(S)
f = convertCtoF(f);
return f;
}
}
return NAN;
}