GY-63_MS5611/libraries/DHT12/examples/DHT12_plotter/DHT12_plotter.ino
2021-01-29 12:31:58 +01:00

33 lines
578 B
C++

//
// FILE: DHT12 _plotter.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.3.0
// PURPOSE: Demo for DHT12 I2C humidity & temperature sensor
//
// HISTORY:
// 0.1.0 2020-04-11 initial version
// 0.3.0 2020-12-19 compatible new version
#include "DHT12.h"
DHT12 DHT(&Wire);
void setup()
{
DHT.begin();
Serial.begin(115200);
Serial.println("Humidity, Temperature");
}
void loop()
{
// note no error checking
DHT.read();
Serial.print(DHT.getHumidity(), 1);
Serial.print(", ");
Serial.println(DHT.getTemperature(), 1);
delay(1000);
}
// -- END OF FILE --