Advertisement
TokioHotel

Untitled

Mar 20th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 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)
  7.   {
  8.     Packet_To_Transmit[index] = temp_high + 48;
  9.   }
  10.   else
  11.   {
  12.     Packet_To_Transmit[index] = temp_high + 55;
  13.   }
  14.  
  15.   if(temp_low < 0x0A)
  16.   {
  17.     Packet_To_Transmit[index+1] = temp_low + 48;
  18.   }
  19.   else
  20.   {
  21.     Packet_To_Transmit[index+1] = temp_low + 55;
  22.   }  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement