Sensor reading problem

Hello guys, im a bit confused in coding here. after i insert this “GetNumber()”(i got it here) in my sketch, my sensor stop updating over time. the only time it updates is when i input those 3 different numbers (v1-v3).

i want to keep my sensors updating after i inputted the 3 values. a bit confusing to me. thanks

#include "DHT.h"
#define DHTPIN 2     // what pin we're connected to
#define DHTTYPE DHT22   // DHT 22  (AM2302)
#define fan 4
#include <Wire.h> 
#include <LiquidCrystal_I2C.h>
#include <Keypad.h>

int v1 = 0;
int v2 = 0;
int v3 = 0;

LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
DHT dht(DHTPIN, DHTTYPE);

//define the keypad
const byte ROWS = 4;
const byte COLS = 4;

char keys[ROWS][COLS] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};

byte rowPins[ROWS] = {13, 12, 11, 10};
byte colPins[COLS] = {9, 8, 7, 6};

Keypad kpd = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);

void setup() {
  pinMode(fan, OUTPUT); 
  dht.begin();
  lcd.begin(20,4);
  lcd.clear();
}

void loop()
{

  float h = dht.readHumidity();
  float t = dht.readTemperature(); //C
  float f = dht.readTemperature(true); //F
  float hic = dht.computeHeatIndex(t, h, false);

    dht.read(h);
    dht.read(t);
    dht.read(f);
    dht.read(hic);
  
  lcd.setCursor(0,0);
  lcd.print("Humidity: ");lcd.print(h);lcd.print(" > ");
  lcd.setCursor(0,1);
  lcd.print("Temp (C): "); lcd.print(t);lcd.print(" > ");
  lcd.setCursor(0,2);
  lcd.print("Temp (F): ");lcd.print(f);lcd.print(" > ");
  lcd.setCursor(0,3);
  lcd.print("Heat Index: ");lcd.print(hic);

  // Check if any reads failed and exit early (to try again).
  if (isnan(h) || isnan(t)) {
    lcd.print("Failed to read from DHT sensor!");
    return;
  }   
     if(t > v1) {
      digitalWrite(fan, HIGH);
  } else {
     digitalWrite(fan, LOW); 
  }
  
   v1 = GetNumber();
  lcd.setCursor(18,0);
  lcd.print(v1);
   v2 = GetNumber();
  lcd.setCursor(18,1);
  lcd.print(v2);
   v3 = GetNumber();
  lcd.setCursor(18,2);
  lcd.print(v3);
}

int GetNumber()
{
   int num = 0;
   char key = kpd.getKey();
   while(key != '#')
   {
      switch (key)
      {
         case NO_KEY:
         break;

         case '0': case '1': case '2': case '3': case '4':
         case '5': case '6': case '7': case '8': case '9':
            num = num * 10 + (key - '0');
            break;

         case '*':
         num = 0;
         lcd.clear();
         delay(1000);
         break;
      }
      key = kpd.getKey();
   }
      return num;
}
    dht.read(h);
    dht.read(t);
    dht.read(f);
    dht.read(hic);

What are you doing here? The read() method takes a boolean, not a float.

PaulS:

    dht.read(h);

dht.read(t);
    dht.read(f);
    dht.read(hic);



What are you doing here? The read() method takes a boolean, not a float.

srry about not deleting those lines, it came from other sketch i testing out. btw sir about my concern in the, i need your help

i need your help

Post the code you are REALLY using, and explain what it does, and does not, do.

Thats the code i really use. It do temperature readings, and compare the readings to the inputted value using a keypad.

So after i add the getNumber code etc, then the sensor readout in the lcd wont update unless i input a value using the keyppad.

Thats the code i really use.

Get rid of the read() calls, then. They are NOT doing anything useful.

Forget the LCD, for now. Debug your program using Serial.print().

i found a solution now thanks, i removed the getnumber() to the loop and placed it under void setup. now for another problem, i want that number to be editable after inputting it, trying to figure it out..