hy all,
i have a project that is measuring temperature using ic lm35 and nodemcu. When the program is compiled successfully. but when connected to the web thinger.io, the device can only connect for less than 10 seconds, then disconnect. is there any wrong code ?? the following programs:
#define SSID “Redmi 3”
#define SSID_PASSWORD “sandiku123”
#define SUHU_PIN A0
String suhu = “”;
int suhu1 = 0;
ThingerESP8266 thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);
void setup() {
pinMode(SUHU_PIN, INPUT);
Serial.begin(9600);
thing.add_wifi(SSID, SSID_PASSWORD);
}
void loop() {
thing.handle();
float temp = analogRead(SUHU_PIN);
float suhu1 = temp*0.322580645;
Serial.println(“suhu1”);
delay(500);
if(suhu1>=80){
thing[“suhu”] >>[](pson& out){
String suhu = String(“FIRE AT KITCHEN!!!”);
out = suhu;
};
}
else {
thing[“suhu”] >>[](pson& out){
String suhu = String(“NONE”);
out = suhu;
};
};
}
thanks in advance.