Beruflich Dokumente
Kultur Dokumente
h>
//period between posts, set at 60 seconds
#define DELAY_PERIOD 60000
//send energy
SendEnergyData(energy);
}
//instruction to send data
void SendEnergyData(float temperature){
char temp[10];
Serial.print("temp: ");
Serial.println(temperature);
//send to ESP8266
mySerial.print("AT+CIPSEND=");
mySerial.println(sendcommand.length());
//display command in serial monitor
Serial.print("AT+CIPSEND=");
Serial.println(sendcommand.length());
if(mySerial.find(">"))
{
Serial.println(">");
}else
{
mySerial.println("AT+CIPCLOSE");
Serial.println("connect timeout");
delay(1000);
return;
}
//Serial.print("Debug:");
//Serial.print(sendcommand);
mySerial.print(sendcommand);
delay(1000);
mySerial.println("AT+CIPCLOSE");
}