From eddd071771a444771ce653f1f368b1ba6adeec1a Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 22 Jul 2019 08:25:18 -0400 Subject: [PATCH] changed temp printf --- afsk/main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 9188ab5a..67d523a0 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -526,14 +526,15 @@ int get_tlm(int tlm[][5]) { if (tempSensor != -1) { int tempValue = wiringPiI2CReadReg16(tempSensor, 0); - #ifdef DEBUG_LOGGING - printf("Temp Sensor Read: %x\n", tempValue); - #endif uint8_t upper = (uint8_t) (tempValue >> 8); uint8_t lower = (uint8_t) (tempValue & 0xff); float temp = (float)lower + ((float)upper / 0x100); - + + #ifdef DEBUG_LOGGING + printf("Temp Sensor Read: %6.1f\n", temp); + #endif + tlm[4][A] = (int)((95.8 - temp)/1.48 + 0.5) % 100; }