I'm trying to add a daily report sent out from my RA twice a day with Temp/PH and WL %... I think I'm doing something wrong with the sprintf. When I had the variables passed directly it through my RA into crazy ass mode and all different ports were going off. When I tried dereferencing & or using the pointer * it was just getting 0 in the values. So, not sure what I'm doing wrong...
Anyway, here's the function:
Code: Select all
void DailyReport() {
static WiFiAlert dailyReport;
char temp[4];
char ph[4];
char wl[3];
char msg[32];
if (now()%(12*SECS_PER_HOUR)+(6*SECS_PER_HOUR)==0) {
ConvertNumToString(temp, ReefAngel.Params.Temp[T1_PROBE], 10);
ConvertNumToString(ph, ReefAngel.Params.PH, 100);
ConvertNumToString(wl, ReefAngel.WaterLevel.GetLevel(), 1);
sprintf(msg,"Temp:+%s+PH:+%s+WL:+%s%",&temp,&ph,&wl);
dailyReport.Send(msg);
}
}