title: Serialdata communication between c# and arduino
body: <p>here is my problem. I use thise piece of code to send a string to my arduino with a serialport:</p>
  
  <pre><code>Arduino.Open();
  Arduino.WriteLine("1.5,3.7,2");
  </code></pre>
  
  <p>After that I receive it with my arduino like this:</p>
  
  <pre><code>char buffer[12];
  String inc;
  
  void setup()
  {
    Serial.begin(115200);
  }
  
  void loop()
  {
   if (Serial.available() &gt;= 11) 
   {
      for (int i=0; i&lt;11   ; i++) 
      {
        buffer[i] = Serial.read();
        inc += buffer[i];
      }
      memset(buffer, 0, sizeof(buffer));
      Serial.println(inc);
      inc = "";
    }
  }
  </code></pre>
  
  <p>If I use the serial monitor the arduino programm runs as intended, reads all the chars and prints them as one string. However if I try to read the string inc from my c# programm I get a format error that looks like this ".7,2????1.5".</p>
  
  <p>I read the serialdata from the arduino with the command:</p>
  
  <pre><code>GlobaleVariablen.Input = Arduino.ReadLine();
  </code></pre>
  
  <p>The baudrate is the same, parity is set to none and stopbits on default as well.
  I hope you can help me, I am getting crazy over this and I just can't find my mistake or why the format is wrong.</p>