Modules-old/Microstrain/Microstrain.cpp
//! Code to extract a floating point number from the IMU
Code to extract a floating point number from the IMU
Code to extract a floating point number from the IMU
static float extract_float(uint8_t* addr) {
  float tmp;
  *((unsigned char*)(&tmp) + 3) = *(addr);
  *((unsigned char*)(&tmp) + 2) = *(addr+1);
  *((unsigned char*)(&tmp) + 1) = *(addr+2);
  *((unsigned char*)(&tmp)) = *(addr+3);
  return tmp;
}
static float extract_float ( uint8_t * addr ) { float tmp ; * ( ( unsigned char * ) ( & tmp ) + 3 ) = * ( addr ) ; * ( ( unsigned char * ) ( & tmp ) + 2 ) = * ( addr + 1 ) ; * ( ( unsigned char * ) ( & tmp ) + 1 ) = * ( addr + 2 ) ; * ( ( unsigned char * ) ( & tmp ) ) = * ( addr + 3 ) ; return tmp ; }
Code to extract a floating point number from the IMU
Code to extract a floating point number from the IMU