Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

bcd to char c

void BCD_To_ASCII(unsigned char bcd_value, char * p_ascii_text)
{
  //--------------------------------------------------
  // BCD contains digits 0 .. 9 in the binary nibbles
  //--------------------------------------------------
  *p_ascii_text++ = (bcd_value >> 4)  + '0';
  *p_ascii_text++ = (bcd_value & 0x0f) + '0';
  *p_ascii_text = '';
  return;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #bcd #char
ADD COMMENT
Topic
Name
4+7 =