title: Comunication between C# and Arduino via bluetooth, receiving strange data
body: <p>I'm trying to send data between an Arduino Mega and a C# windows form application via Bluetooth.</p>
  <p>From Arduino to C# all goes well, however, when sending from C# to Arduino I get some strange values:
  Sending &quot;abcde&quot; outputs 79 167 186 170 2. I assume each one of the values represents a letter, as sending only &quot;a&quot; outputs 79.</p>
  <p>However, I can't see why I get this values and not ascii ones, for example.</p>
  <p>Here's the relevant C# code:</p>
  <pre><code>if (serialPort1.IsOpen) serialPort1.Close();
  serialPort1.PortName = &quot;COM&quot; + x.ToString();
  serialPort1.BaudRate = 9600;
  try
  {
      if (!serialPort1.IsOpen) serialPort1.Open();
  }
  catch (Exception ex)
  {
      MessageBox.Show(ex.Message);
  }
  serialPort1.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(DataReceived);
   
  </code></pre>
  <p>Every second, a function is called, being dataToSend &quot;abcde&quot;, for example:</p>
  <pre><code>private void DataSender(string dataToSend)
  {
      serialPort1.Write(dataToSend);
      //MessageBox.Show(dataToSend);
  }
  </code></pre>
  <p>And all of the Arduino code (I'm using a Arduino Mega which has 4 serial ports):</p>
  <pre><code>void setup() {
    Serial.begin(9600);
    Serial3.begin(9600);
  }
  
  void loop() {
    if (Serial3.available() &gt; 0) {
      delay(10);
      int x = Serial3.read();
      delay(10);
      Serial.println(x);
    }
  }
  </code></pre>
  <p>I tried adding delays to see if the data was better obtained, but it didn't work. Any ideas what I'm missing here? I assume it has something to do with the way data is encrypted to be sent, but I have no idea.</p>