-1
#include <dht.h>
dht DHT;
#define DHT11_PIN 2     // what pin we're connected to  // DHT 11 

String TextForSms ;
String humidity = " Humidity: %";
String temperature = "   Temperature";
String sign = " *C";
char fromc;

void setup() {
  Serial.begin(9600); 
}

void loop() {
  int chk = DHT.read11(DHT11_PIN);
  float h = DHT.humidity;
  float t = DHT.temperature; 
  delay(2000);
  }

  TextForSms = TextForSms + t + "," + h + ","; 
Serial.println(TextForSms); 
     TextForSms = ""; 
   delay(1000);   

closed as off-topic by Juraj, sempaiscuba, per1234, gre_gor, MatsK Jan 8 at 14:29

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be about Arduino, within the scope defined in the help center." – Juraj, sempaiscuba, per1234, MatsK
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Please add a sentence to describe the question. What are you actually asking? – MichaelT Dec 31 '18 at 16:07
0

This whole section:

  TextForSms = TextForSms + t + "," + h + ","; 
Serial.println(TextForSms); 
     TextForSms = ""; 
   delay(1000);   

is outside a block. Code must be inside a block.

There are strict rules governing what can go where in a C or C++ program. I suggest you learn them.

Not the answer you're looking for? Browse other questions tagged or ask your own question.