Data Sensor Suhu
#include<stdio.h>
int main()
{
short unsigned int hex_data;
char msb,lsb;
float temp;
int sign=1;
printf("Enter hex data\n");
scanf("%hx",&hex_data);
printf("%hx",hex_data);
msb=(hex_data>>8);
printf("%c",msb);
lsb=hex_data;
if((msb>>8)&1)
{
sign=(-1);
printf("Enter\n");
temp=msb+((lsb<<7)&1)*0.5;
}
temp=(sign*(msb+(((lsb>>8)&1)*0.5)));
printf("%0.1f",temp);
}
SURAJ BIRADAR