2022-05-19 06:33:49 -04:00
|
|
|
//
|
|
|
|
// FILE: dht11_two.ino
|
|
|
|
// AUTHOR: Rob Tillaart
|
|
|
|
// PURPOSE: DHT library test sketch for DHT11 && Arduino
|
|
|
|
// URL: https://github.com/RobTillaart/DHTstable
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "DHTStable.h"
|
|
|
|
|
|
|
|
|
|
|
|
DHTStable DHT_A;
|
|
|
|
DHTStable DHT_B;
|
|
|
|
|
|
|
|
#define DHT11_PIN_A 5
|
|
|
|
#define DHT11_PIN_B 6
|
|
|
|
|
|
|
|
|
|
|
|
void setup()
|
|
|
|
{
|
|
|
|
Serial.begin(115200);
|
|
|
|
Serial.println(__FILE__);
|
|
|
|
Serial.print("LIBRARY VERSION: ");
|
|
|
|
Serial.println(DHTSTABLE_LIB_VERSION);
|
|
|
|
Serial.println();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void loop()
|
|
|
|
{
|
|
|
|
Serial.print("DHT A:\t");
|
2022-10-01 07:17:26 -04:00
|
|
|
DHT_A.read11(DHT11_PIN_A);
|
2022-05-19 06:33:49 -04:00
|
|
|
Serial.print(DHT_A.getHumidity());
|
|
|
|
Serial.print(",\t");
|
|
|
|
Serial.println(DHT_A.getTemperature());
|
|
|
|
|
|
|
|
|
|
|
|
Serial.print("DHT B:\t");
|
2022-10-01 07:17:26 -04:00
|
|
|
DHT_B.read11(DHT11_PIN_B);
|
2022-05-19 06:33:49 -04:00
|
|
|
Serial.print(DHT_B.getHumidity());
|
|
|
|
Serial.print(",\t");
|
|
|
|
Serial.println(DHT_B.getTemperature());
|
|
|
|
|
|
|
|
delay(2000);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// -- END OF FILE --
|