Hi people i m a pleased owner of a netduino plus and recently i bought a bluetooth device JY-MCU HC-06 from dealextreme.
I test the device with an arduino nano v3.0 and it works perfect but when i tried with netduino, it has a weird behaviour. Send bytes works perfect but receive data works very bad. I pair it with my phone and with BlueTerm app send some data. When i send "1", byte 49, i receive byte 32.
Wired Netduino -> JY-MCU HC-06:
COM1 ( Pin 0 / RX - Pin 1 / TX ) -> TX - RX.
No resistors between.
I tested the serial communication with an arduino. Wiring Arduino serial pins to netduino serial COM1 pins and run a program for send data between both. All works perfect send and receive.
Anybody could help me please?.
This is the code for Netduino:
public class Program
{
static SerialPort serial;
public static void Main()
{
serial = new SerialPort(Serial.COM1, 9600, Parity.None, 8, StopBits.One);
serial.Open();
serial.DataReceived += serial_DataReceived;
Thread.Sleep(Timeout.Infinite);
}
static void serial_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
byte[] bytes = new byte[1];
while (serial.BytesToRead > 0)
{
serial.Read(bytes, 0, bytes.Length);
serial.Write(bytes, 0, bytes.Length);
}
}
}