Search
 
SCRIPT & CODE EXAMPLE
 

C

temperature sensor data


#include<stdio.h>
int main()
{    
  short unsigned int hex_data;   
  char msb,lsb;   
  float temp;    
  int sign=1;   
   printf("Enter hex data
"); 
  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
");    
    temp=msb+((lsb<<7)&1)*0.5;  
  }    
  temp=(sign*(msb+(((lsb>>8)&1)*0.5)));  
  printf("%0.1f",temp); 
}
Comment

PREVIOUS NEXT
Code Example
C :: perl file handling 
C :: jock cranley 
C :: How to scale all columns in dataframe in R? 
C :: ESP32 timerBegin(0, cpuClock, true); 
C :: arcolinux 
C :: c pointers to struct 
C :: bc1q9rfht42zayr3yvxqjw8tm6v3tkwl93t35gegxl 
C :: 25802 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of D:Devtoolsminicondalibsite-packages ensorflowpythonclient\_pywrap_tf_session.pyd 
C :: uri/beecrowd problem no - 1133 solution in C 
C :: redis endpoint 
C :: Array in element from lowest 
C :: what is the difference between algorithm and flowchart in c program 
C :: reverse string in c 
C :: ::template 
C :: String insertion into another string 
C :: lazer codechef 
C :: what to do after gan training 
C :: arma 3 nearest terrain objects 
C :: params in main function in C 
C :: aws solution architect vs developer associate 
C :: crear funcion en c 
Dart :: flutter appbar backbutton remove 
Dart :: ElevatedButton flutter style 
Dart :: make a rounded container flutte 
Dart :: height appbar flutter 
Dart :: dart timer 
Dart :: how to get screen size in flutter 
Dart :: how to repeatedly call a function flutter 
Dart :: how to change flutter text font 
Dart :: flutter firestore crud 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =