title: Displaying integer on an LCD
body: <p>I'm trying to display an integer on an LCD-Display. The way the Lcd works is that you send an 8-Bit ASCII-Character to it and it displays the character.</p>
  
  <p>The code I have so far is:</p>
  
  <pre><code>unsigned char text[17] = "ABCDEFGHIJKLMNOP";
  int32_t n = 123456;
  lcd.printInteger(text, n);
  
  //-----------------------------------------  
  
  void LCD::printInteger(unsigned char headLine[17], int32_t number)
  {
      //......
  
  
      int8_t str[17];
      itoa(number,(char*)str,10);
  
  
      for(int i = 0; i &lt; 16; i++)
      {
          if(str[i] == 0x0)
          break;
  
          this-&gt;sendCharacter(str[i]);
          _delay_ms(2);
  
      }
  }
  void LCD::sendCharacter(uint8_t character)
  {
      //....
  
      *this-&gt;cOutputPort = character;
  
      //...
  
  }
  </code></pre>
  
  <p>So if I try to display <code>123456</code> on the LCD, it actually displays <code>-7616</code>, which obviously is not the correct integer. </p>
  
  <p>I know that there is probably a problem because I convert the characters to signed <code>int8_t</code> and then output them as unsigned <code>uint8_t</code>. But I have to output them in unsigned format. I don't know how I can convert the <code>int32_t</code> input integer to an ASCII <code>uint8_t</code>-String.</p>