title: Invalid characters Arduino, Bluetooth (HM10 ) and Xamarin.Forms
body: <p>I am having an issue trying to send commands to my Arduino Mega from my Android  Xamarin.Forms app. When i use Bluetooth terminal app from play store it works, but my code does not. In the Arduino terminal i am just getting squares as if it is a baud rate issue or something. but from what i can see the baud rate is always determined by the device, which defaults to 9600 for the HM10. </p>
  
  <p>I am using this library for the bluetooth <a href="https://github.com/xabre/xamarin-bluetooth-le" rel="nofollow noreferrer">https://github.com/xabre/xamarin-bluetooth-le</a></p>
  
  <p><strong>Arduino Sketch (works with bt terminal app)</strong></p>
  
  <pre><code>void loop()
  {
      // Read from the Bluetooth module and send to the Arduino Serial Monitor
      if (Serial3.available())
      {
          byte y = Serial3.read();
           //int x = (int)y;
          Serial.write(y);
      }
  
  
      // Read from the Serial Monitor and send to the Bluetooth module
      if (Serial.available())
      {
          c = Serial.read();
  
          // do not send line end characters to the HM-10
          if (c != 10 &amp; c != 13)
          {
              Serial3.write(c);
          }
  
          // Echo the user input to the main window. 
          // If there is a new line print the "&gt;" character.
          if (NL) { Serial.print("\r\n&gt;"); NL = false; }
              Serial.write(c);
          if (c == 10) { NL = true; }
      }
  }
  </code></pre>
  
  <p><strong>Then my send code in my Xamarin.Forms app</strong></p>
  
  <pre><code>    private async Task Button_ClickedAsync(object sender, EventArgs e)
      {
          if (_charataristice != null &amp;&amp;  _charataristice.CanWrite)
          {
              var data = Convert.ToByte(16);
              _charataristice.WriteType = CharacteristicWriteType.WithoutResponse;
              await _charataristice.WriteAsync(new[] { data });
          }
  
      }
  </code></pre>
  
  <p>Would appreciate any help, the value i am trying to revive is alwasy a number and should fall within one byte. </p>