Advertisement
TokioHotel

Untitled

Mar 20th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. void Convert_Hex_To_Ascii_Measures(uint8_t value,uint16_t index)
  2. {
  3.   uint8_t temp_high = value >> 4;
  4.   uint8_t temp_low  = value & 0x0F;
  5.  
  6.   if(temp_high < 0x0A) { Packet_To_Transmit[index] = temp_high + 48;}
  7.   else { Packet_To_Transmit[index] = temp_high + 55; }
  8.  
  9.   if(temp_low < 0x0A) { Packet_To_Transmit[index+1] = temp_low + 48; }
  10.   else { Packet_To_Transmit[index+1] = temp_low + 55; }  
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement