What I have is
Code: Select all
#define NUM_DHTS (sizeof(dhtList)/sizeof(DHT*))
typedef char humStr[7]; //4 digits + decimal point + 1 decimal + null terminator
typedef char tempStr[7]; //4 digits + decimal point + 1 decimal + null terminator
humStr numhum[NUM_DHTS];
tempStr numtemp[NUM_DHTS];
typedef char* channel[8];
channel channelzero[8];
channel channelone[8];
channel channeltwo[8];
channel channelthree[8];
channel* channels[] = {&channelzero, &channelone, &channeltwo, &channelthree};
Code: Select all
int j=0;
for (int i = 0; i <7; i ++)
{
channelzero[i] = numtemp[j];
i += 1;
channelzero[i] = numhum[j];
j += 1;
}
channelzero[8] = { "79F" , "28%" , "82F" , "33%" , "28F" , "10%" , "99F" , "77%"}
Now, what I am wanting to do is create a pointer that points to each of my 4 arrays so I can run a loop like this:
Code: Select all
for (int i = 0; i <4 ; i++)
{
char* chan[] = channel[i];
for (int c = 0; c < 7 ; c ++)
{
strcat(transmission,fields[c]);
strcat(transmission,chan[c]);
}
strcat(thingSpeakAPI, thingSpeakX);
strcat(thingSpeakAPI, writeAPIKey[i]);
Serial.println(transmission);
Serial.println(thingSpeakAPI);
updateThingSpeak(transmission, thingSpeakAPI);
memset(transmission, '\0', 150);
}
}
Thank you in advance for your help.
Tim