1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-26 23:11:19 +01:00

tests/driver_sht2x: avoid negative number after decimal dot

Also don't include printf_float
This commit is contained in:
Kees Bakker 2019-09-03 20:50:25 +02:00
parent 0bf2be43eb
commit 3d6b6d868d
2 changed files with 2 additions and 2 deletions

View File

@ -5,6 +5,5 @@ FEATURES_REQUIRED = periph_i2c
USEMODULE += sht2x
USEMODULE += xtimer
USEMODULE += printf_float
include $(RIOTBASE)/Makefile.include

View File

@ -19,6 +19,7 @@
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
@ -88,7 +89,7 @@ int main(void)
printf("Temperature [°C]: %d.%d\n"
"Humidity [%%RH]: %u.%02u\n"
"\n+-------------------------------------+\n",
temperature / 100, (temperature % 100) / 10,
temperature / 100, abs(temperature % 100) / 10,
(unsigned int)(humidity / 100), (unsigned int)(humidity % 100)
);
}