- Sun Jun 07, 2015 1:09 am
#19716
Thanks Cal
The only difference between your code and the printout code I have is a divide by 10 on the altitude and that still doesn't make sense.
void sensor_timerfunc(void *arg)
{
int32_t temperature;
int32_t pressure;
char buff[20];
ets_uart_printf("Get temperature and pressure...\r\n");
temperature = BMP180_GetTemperature();
pressure = BMP180_GetPressure(OSS_0);
console_printf("Temperature: %s *C\r\n", BMP180_Int2String(buff, temperature));
console_printf("Temperature: %d.%d *F\r\n", (int)(9 * temperature / 50 + 32), (int)(9 * temperature / 5 % 10));
console_printf("Pressure: %d mm rt.st.\r\n", (int)(pressure/133.322368));
console_printf("Pressure: %d m water.st.\r\n", (int)(pressure/9806.65));
console_printf("Pressure: %d.%d mbar\r\n", (int)(pressure), (int)(pressure%100));
console_printf("Pressure: %d.%d mmHg\r\n", (int)(pressure * 75 / 10000), (int)((pressure * 75 % 10000) / 1000));
console_printf("Altitude: %d\r\n", BMP180_CalcAltitude(pressure));
}
So that's the code I have - which produces an output of 101,699 mBar - which to my way of thinking is 100 * too much... and altitude of 103560 - it doesn't say WHAT unit of measure but assuming your cod is later, that would be 10, 356 - one has to assume that's 10,000 metres and that is just way out of order...
I could of course just divide the whole lot by 10,000 and get something that looks half reasonable but I'm assuming the reading is miles out for a reason?
cal wrote:But thats only the reading of the values not the printing.
Following the link in the source code lead me to
https://github.com/CHERTS/esp8266-i2c_b ... ser_main.c
Which prints the pressure in Pa which should be your 100.000 value.
Please look at your code that prints the pressure.
Cal