Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float BMP180_ReadTemperature()
- {
- /* Start temperature conversion */
- TM_BMP180_StartTemperature(&BMP180);
- /* Wait delay */
- Delay(BMP180.Delay);
- /* Read temperature first */
- TM_BMP180_ReadTemperature(&BMP180);
- return BMP180.Temperature-1.3;
- }
- float BMP180_ReadPressure()
- {
- /* Start temperature conversion */
- TM_BMP180_StartTemperature(&BMP180);
- /* Wait delay */
- Delay(BMP180.Delay);
- /* Read temperature first */
- TM_BMP180_ReadTemperature(&BMP180);
- /* Start pressure conversion at ultra high resolution */
- TM_BMP180_StartPressure(&BMP180, TM_BMP180_Oversampling_HighResolution);
- Delay(BMP180.Delay);
- /* Read pressure value */
- TM_BMP180_ReadPressure(&BMP180);
- // Auf mBar Meereshöhe umrechnen
- double pressure_normal = (double)BMP180.Pressure / 100;
- if ((pressure_normal < MIN_PRES) || (pressure_normal > MAX_PRES))
- return 1013.0;
- float foo = pressure_normal / pow(1-(0.0065 * HOEHE_ORT) / 288.15, 5.255);
- return foo;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement