#include "DHTesp.h"
const int temp_input = 4;
int temp = 0;
DHTesp temp_sensor;
void setup() {
// put your setup code here, to run once:
pinMode(temp_input, INPUT);
Serial.begin(115200);
Serial.println("Hello, ESP32!");
temp_sensor.setup(temp_input, DHTest::DHT22);
}
void loop() {
TempAndHumidity data = temp_sensor.getTempAndHumidity();
Serial.println("Temp: " + String(data.temperature, 2) + "°C");
Serial.println("Humidity: " + String.(data.humidity, 1) + "%");
Serial.println("---");
//temp2 = calcVolt(temp);
//Serial.println(temp2);
// put your main code here, to run repeatedly:
delay(2000); // this speeds up the simulation
}