From aa188e32f90030765e3168e1357a266236231455 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 24 Jul 2019 11:59:49 -0400 Subject: [PATCH] fixed temp --- afsk/telem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afsk/telem.c b/afsk/telem.c index 9c2ab81c..7fc07c44 100644 --- a/afsk/telem.c +++ b/afsk/telem.c @@ -207,12 +207,12 @@ int main(int argc, char *argv[]) { printf("Bus | sensor[%d] % 4.2fV % 6.1fmA % 6.1fmW \n", BUS, readingV.voltage, readingV.current, readingV.power); - tempSensor = config_sensor("/dev/i2c-3", 0x48, 0); + sensorV = config_sensor("/dev/i2c-3", 0x48, 0); sensorV = config_sensor("/dev/i2c-1", 0x45, 400); if (sensorV.fd != OFF) { - int tempValue = wiringPiI2CReadReg16(SensorV.fd, 0); + int tempValue = wiringPiI2CReadReg16(sensorV.fd, 0); uint8_t upper = (uint8_t) (tempValue >> 8); uint8_t lower = (uint8_t) (tempValue & 0xff); float temp = (float)lower + ((float)upper / 0x100);