/******************************************************************************
Click on the green Run button above
*******************************************************************************/
#include <stdio.h>
#include <stdint.h>
int main(void)
{
float t = 21.75;
int8_t b = (t + 10.0f) * 2.0f;
printf("Encode value %0.2f °C to %d\n", t, b); //Encode value 21.75°C to 63
float t2 = (b / 2.0f) - 10.0f;
printf("Decode %d to %.02f °C\n", b, t2); //Decode 63 to 21.50°C
return 0;
}