my main goal is to print readings from ldr and dht 22/11 onto a lcd screen but im having one trouble. the code below shows a snippet of the code im testing. i want it to combine two float values into strings so i can easily create a function to print the temp and humidity. although i was testing an added Serial.Print(Temp); which only prints "Temp: ?" but i want it to print "Temp: (insert Temp)"
here is the snippet of code.
float f = dht.readTemperature(true);
float h = dht.readHumidity();
float t = dht.readTemperature();
char Temp[16] = "Temp: ";
char H[16] = "Humi: ";
char t_str[16];
char h_str[16];
snprintf(t_str, sizeof(t_str), "%.2f", t);
snprintf(h_str, sizeof(h_str), "%.2f", h);
strncat(Temp, t_str, sizeof(Temp)-strlen(Temp)-1);
strncat(H, h_str, sizeof(H)-strlen(H)-1);
Serial.print(Temp);