Hi,
I would like to ask for some help. I want extend my code. Now I am writing temperature values to array ( for example char pageadd[128] ) with sprintf.
Than sending it to the cloud and also to SD card:
sprintf(pageAdd,"/update?key=XXXXXXXXXXXXX&field1=%i&field2=%i&field3=%i&field4=%i&field5=%i",temp0,temp1,temp2,temp3,temp4);
if(!getPage(server,pageAdd)) Serial.print(F("Fail "));
else Serial.print(F("Pass "));
defining logfile and sending to SD:
int logFile(char* sdate, char* stime, int temp0, int temp1, int temp2, int temp3, int temp4) {
File fh = SD.open("xyz.txt",FILE_WRITE);
if(!fh) {
Serial.println(F("Open fail"));
return 0;
}
sprintf(pageAdd,"%s,%s,%i,%i,%i,%i,%i;",sdate,stime,temp0,temp1,temp2,temp3,temp4);
fh.println(pageAdd);
fh.close();
return 1;
This cloud cannot handle more than 8 fields for one sending. So I would like to send with another update key another 5 values.
Do I have to use another array instead of PageAdd for example? The lenght is ok, but should it be empty before new sending? I am confused.
Or I have just another sprintf defined like:
sprintf(pageAdd,"/update?key=YYYYYYYYYYYYYY&field1=%i&field2=%i&field3=%i&field4=%i&field5=%i",temp5,temp6,temp7,temp8,temp9);
Thank you!