title: How to convert int to string on Arduino?
body: <p>How do I convert an int, <code>n</code>, to a string so that when I send it over the serial, it is sent as a string?</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>int ledPin=13;
  int testerPin=8;
  int n=1;
  
  char buf[10];
  
  void setup()
  {
      pinMode(ledPin, OUTPUT);
      pinMode(testerPin, OUTPUT);
      Serial.begin(115200);
  }
  
  void loop()
  {
      digitalWrite(ledPin, HIGH);
      sprintf(buf, "Hello!%d", n);
      Serial.println(buf);
      delay(500);
      digitalWrite(ledPin, LOW);
      delay(500);
  
      n++;
  }
  </code></pre>