bugfix format

This commit is contained in:
Harald Pichler 2017-03-03 11:29:32 +01:00
parent f36183f2b5
commit c954d22d81

View file

@ -71,33 +71,16 @@ void loop (void)
bmpatm = bme.readPressure() / 100.0F;
bmphum = bme.readHumidity();
dtostrf(bmptemp , 6, 2, bmptemp_s );
dtostrf(bmppress , 6, 2, bmppress_s );
dtostrf(bmpalt , 6, 2, bmpalt_s );
dtostrf(bmpatm , 6, 2, bmpatm_s );
dtostrf(bmphum , 6, 2, bmphum_s );
// remove space
if(bmptemp_s[0]==' '){
memcpy (bmptemp_s,bmptemp_s+1,strlen(bmptemp_s)+1);
}
if(bmppress_s[0]==' '){
memcpy (bmppress_s,bmppress_s+1,strlen(bmppress_s)+1);
}
if(bmpalt_s[0]==' '){
memcpy (bmpalt_s,bmpalt_s+1,strlen(bmpalt_s)+1);
}
if(bmpatm_s[0]==' '){
memcpy (bmpatm_s,bmpatm_s+1,strlen(bmpatm_s)+1);
}
if(bmphum_s[0]==' '){
memcpy (bmphum_s,bmphum_s+1,strlen(bmphum_s)+1);
}
dtostrf(bmptemp , 0, 2, bmptemp_s );
dtostrf(bmppress , 0, 2, bmppress_s );
dtostrf(bmpalt , 0, 2, bmpalt_s );
dtostrf(bmpatm , 0, 2, bmpatm_s );
dtostrf(bmphum , 0, 2, bmphum_s );
// Debug Print
printf("Temp: %s\n",bmptemp_s);
printf("Press: %s\n",bmppress_s);
printf("Altitude: %s\n",bmpalt_s);
printf("atm: %s\n",bmpatm_s);
printf("hum: %s\n",bmphum_s);
// printf("Temp: %s\n",bmptemp_s);
// printf("Press: %s\n",bmppress_s);
// printf("Altitude: %s\n",bmpalt_s);
// printf("atm: %s\n",bmpatm_s);
// printf("hum: %s\n",bmphum_s);
}