Skip to content

Commit

Permalink
Update output format
Browse files Browse the repository at this point in the history
  • Loading branch information
MaJerle committed Mar 20, 2020
1 parent 9d2da8c commit 8f393f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dev/VisualStudio/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ main(void) {
float temp;
uint8_t resolution = ow_ds18x20_get_resolution_raw(&ow, &rom_ids[i]);
if (ow_ds18x20_read_raw(&ow, &rom_ids[i], &temp)) {
printf("Sensor %u temperature is %d.%d degrees (%u bits resolution)\r\n",
printf("Sensor %3u temperature is %d.%03d degrees (%u bits resolution)\r\n",
(unsigned)i, (int)temp, (int)((temp * 1000.0f) - (((int)temp) * 1000)), (unsigned)resolution);
}
}
Expand Down

0 comments on commit 8f393f7

Please sign in to comment.