int trigger_pin = 14;
int echo_pin = 12;
int led_pin = 16;
#include "DHTesp.h"
DHTesp dhtSensor;
TempAndHumidity data;
const int DHT_PIN = 18;

void setup()
{
Serial.begin(115200);
pinMode(trigger_pin, OUTPUT);
pinMode(echo_pin, INPUT);
pinMode(led_pin, OUTPUT);
dhtSensor.setup(DHT_PIN, DHTesp::DHT22);
}
int rocket()
{
  digitalWrite(trigger_pin, LOW);
  delay(10);
  digitalWrite(trigger_pin, HIGH);
  Serial.println("ok");
  delay(100);
  digitalWrite(trigger_pin, LOW);

  float rs = pulseIn(echo_pin,HIGH);
  return(rs*0.034/2)+1;
  delay(1000);
}
void loop()
{
  data=dhtSensor.getTempAndHumidity();
int c = rocket();
if(c>200 && data.humidity<30 && data.temperature>70)
{
  digitalWrite(led_pin, HIGH);
  }
  
else if(c<200 && data.humidity>30 && data.temperature<70)
{
  digitalWrite(led_pin, LOW);
  }

Serial.println(String(c));

 Serial.println("humi:"+String(data.humidity,1));
  Serial.println("Temp:"+String(data.temperature,2));
  Serial.println("...................");
  delay(1000);
}
esp:0
esp:2
esp:4
esp:5
esp:12
esp:13
esp:14
esp:15
esp:16
esp:17
esp:18
esp:19
esp:21
esp:22
esp:23
esp:25
esp:26
esp:27
esp:32
esp:33
esp:34
esp:35
esp:3V3
esp:EN
esp:VP
esp:VN
esp:GND.1
esp:D2
esp:D3
esp:CMD
esp:5V
esp:GND.2
esp:TX
esp:RX
esp:GND.3
esp:D1
esp:D0
esp:CLK
ultrasonic1:VCC
ultrasonic1:TRIG
ultrasonic1:ECHO
ultrasonic1:GND
dht1:VCC
dht1:SDA
dht1:NC
dht1:GND
led1:A
led1:C