Works with test hardware
This commit is contained in:
@@ -1,19 +1,23 @@
|
||||
using System;
|
||||
using PInvokeSerialPort;
|
||||
using Nefarius.Peripherals.SerialPort;
|
||||
|
||||
namespace PInvokeSerialPort.Sample
|
||||
namespace PInvokeSerialPort.Sample;
|
||||
|
||||
internal class Program
|
||||
{
|
||||
class Program
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
static void Main(string[] args)
|
||||
var serialPort = new SerialPort("com7") { UseRts = HsOutput.Online };
|
||||
|
||||
serialPort.DataReceived += x =>
|
||||
{
|
||||
var serialPort = new SerialPort("com1", 14400);
|
||||
serialPort.DataReceived += x => Console.Write((char)x);
|
||||
serialPort.Open();
|
||||
while (true)
|
||||
{
|
||||
serialPort.Write(Console.ReadKey().KeyChar);
|
||||
}
|
||||
}
|
||||
Console.Write($"{x:X2} ");
|
||||
};
|
||||
|
||||
serialPort.Open();
|
||||
|
||||
serialPort.Write("START\r\n");
|
||||
|
||||
Console.ReadKey();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user