title: Hex to Ascii conversion C
body: <p>My Challenge is to convert hex value to ascii, the input is a pointer to an uint8 so I need a byte by byte conversion and there is a size input as well (no of bytes) and the inputs are all hex values,Please help me find whats wrong with my code.</p>
  
  <p>Output was 0 always</p>
  
  <pre><code>uint8 ReferenceNumber[8] = {0x30,0x40,0x60,0x50,0x80,0x60,0x75,0x95};
  HexToAscii(&amp;ReferenceNumber[0], output, 8); 
  
  static void HexToAscii(uint8* input, uint8 *output, uint8 size)//No of bytes
  {
      uint8 i, temp;
  
      for(i=1; i&lt;=size; i++)
      {
          temp = (*(input)) &gt;&gt; (4*(i-1));
          temp &amp;= 0x0F;
          temp +='0';
          if (temp &gt;= (10+'0'))
          {
              temp += ('A'-10-'0');
          }
          *(output+size-i) = temp;
      }
  }
  </code></pre>