1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #12140 from aabadie/pr/tests/driver_bmp180_cleanup

tests/driver_bmp180: cleanup application
This commit is contained in:
benpicco 2019-09-02 21:55:29 +02:00 committed by GitHub
commit 7cbc239a00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,6 @@ include ../Makefile.tests_common
USEMODULE += bmp180
USEMODULE += xtimer
USEMODULE += printf_float
# set default altitude
TEST_ALTITUDE ?= 158 # altitude in Polytechnique School campus

View File

@ -18,6 +18,7 @@
* @}
*/
#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>
@ -73,12 +74,12 @@ int main(void)
/* Get altitude in meters */
int16_t altitude = bmp180_altitude(&dev, pressure_0);
printf("Temperature [°C]: %d.%d\n"
printf("Temperature [°C]: %i.%d\n"
"Pressure [hPa]: %lu.%d\n"
"Pressure at see level [hPa]: %lu.%d\n"
"Altitude [m]: %i\n"
"\n+-------------------------------------+\n",
(int)(temperature / 10), (int)(temperature % 10),
(int)(temperature / 10), abs(temperature % 10),
(unsigned long)pressure / 100, (int)(pressure % 100),
(unsigned long)pressure_0 / 100, (int)(pressure_0 % 100),
(int)altitude);