remove first space from converted string

This commit is contained in:
Harald Pichler 2015-09-16 10:31:52 +02:00
parent 6b41f23d59
commit a2e70d49f3

View file

@ -57,6 +57,13 @@ void loop (void)
mcusleepcycle=32; // sleep, wakeup every 32 cycles
dtostrf(htu21d_temp , 6, 2, htu21d_temp_s );
dtostrf(htu21d_hum , 6, 2, htu21d_hum_s );
// remove space
if(htu21d_temp_s[0]==' '){
memcpy (htu21d_temp_s,htu21d_temp_s+1,strlen(htu21d_temp_s)+1);
}
if(htu21d_hum_s[0]==' '){
memcpy (htu21d_hum_s,htu21d_hum_s+1,strlen(htu21d_hum_s)+1);
}
// debug only
// printf("Temp: %s",htu21d_temp_s);