I want test my serial communication between my Arduino and my PC, i want do that because when i connect my arduino to my serial bus i didn´t receive some data.
I have connected my PC over rs232 to my Arduino mega and from the Arduino back to the PC. Now i want send a 9-bit byte to the Arduino and back to the PC, when that works i know that my serial bus is the problem.
Question:
How can i set the mark parity?
My code to test a "normal" byte(8 bit) is written in Visual C# i hope i can use them again and must only fix a bit.
Here the code:
using System;
using System.Collections.Generic;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Threading;
namespace ConsoleApplication5
{
class Program
{
static void Main(string[] args)
{
System.IO.Ports.SerialPort port = new SerialPort("COM5", 4800);
try
{
port.Open();
while (true)
{
//if (port.BytesToRead > 0)
{
port.Write("A");
}
}
}
catch (Exception) // Press CTRL-C to exit.
{
port.Close();
Console.WriteLine("C");
}
port.Close();
}
}
}
I hope someone can help me with friendly wishes sniffi