title: C# GUI to Arduino: Serial Data Not Working
body: <p>I'm trying to send an integer through the usb connection to my arduino. When using the sketch monitor I can verify that the code works; However, when using the C# .NET GUI, I'm unable to get anything working.</p>
  <p>I do know that the data is sending via the LEDs lighting up on the arduino.</p>
  <p>I'm typing an RPM into a text box, converting it to 4 bytes (integer) and writing it. Here is the GUI code:</p>
  <pre><code>RPMMove = Convert.ToInt32(tbRPM.Text);
  byte[] bRPM = BitConverter.GetBytes(RPMMove);
  port.Write(bRPM, 0, 4);
  </code></pre>
  <p>On the arduino:</p>
  <pre><code>void setup()
  {
  Serial.begin(9600);
  Serial.setTimeout(100);
  }
  void loop()
  {
  while (Serial.available() &gt; 0)
    {
        i = Serial.parseInt();
        stepper.setRPM(i); //move motor of other library
        //Serial.println(i); //I get the correct integer via the arduino monitor here.
    }
  }
      
  </code></pre>