Hi Harish! You could, for example, use a function like this: float hex_to_float( uint8_t * hex_array ); uint8_t float_in_hex[4] = { 0x43, 0xCf, 0x80, 0x00 }; float float_from_hex; ... void main( void ) { ... float_from_hex = hex_to_float( float_in_hex ); ... } float hex_to_float( uint8_t * hex_array ) { float result; uint8_t counter; uint8_t * pointer; pointer = (uint8_t *) &result; for( counter = 0; counter < sizeof( float ); counter++ ) { *(pointer + counter) = *(hex_array + sizeof( float ) - 1 - counter); } return result; } Dennis
↧