mirror of
https://github.com/shakemid/pcsensor-temper.git
synced 2025-01-21 00:58:17 +01:00
Change printf
This commit is contained in:
parent
71a903e649
commit
5de95d4d16
1 changed files with 13 additions and 12 deletions
25
pcsensor.c
25
pcsensor.c
|
@ -428,18 +428,19 @@ int main(int argc, char **argv) {
|
|||
devices[i].type->decode_func(answer, tempd, calibration);
|
||||
|
||||
// print temperature
|
||||
if (formato==2) {
|
||||
// in Fahrenheit
|
||||
printf("%s\t%d\tinternal\t%.2f F\n", strdate, i, (9.0 / 5.0 * tempd[0] + 32.0));
|
||||
if (devices[i].type->has_sensor == 2) {
|
||||
printf("%s\t%d\texternal\t%.2f F\n", strdate, i, (9.0 / 5.0 * tempd[1] + 32.0));
|
||||
}
|
||||
} else {
|
||||
// in Celsius
|
||||
printf("%s\t%d\tinternal\t%.2f C\n", strdate, i, tempd[0]);
|
||||
if (devices[i].type->has_sensor == 2) {
|
||||
printf("%s\t%d\texternal\t%.2f C\n", strdate, i, tempd[1]);
|
||||
}
|
||||
printf("%s\t%d\t%s\t%.2f %s\n",
|
||||
strdate,
|
||||
i,
|
||||
devices[i].type->has_sensor == 2 ? "internal" : "temperature",
|
||||
formato == 2 ? 9.0 / 5.0 * tempd[0] + 32.0 : tempd[0],
|
||||
formato == 2 ? "F" : "C");
|
||||
|
||||
if (devices[i].type->has_sensor == 2) {
|
||||
printf("%s\t%d\texternal\t%.2f %s\n",
|
||||
strdate,
|
||||
i,
|
||||
formato == 2 ? 9.0 / 5.0 * tempd[1] + 32.0 : tempd[1],
|
||||
formato == 2 ? "F" : "C");
|
||||
}
|
||||
|
||||
// print humidity
|
||||
|
|
Loading…
Add table
Reference in a new issue