changed temp printf

pull/17/head
alanbjohnston 7 years ago committed by GitHub
parent b9b8d7e826
commit eddd071771
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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;
}

Loading…
Cancel
Save

Powered by TurnKey Linux.