Nefarius.Peripherals.Serial.../PInvokeSerialPort.Sample/Program.cs

20 lines
415 B
C#
Raw Normal View History

2012-03-03 10:50:54 +01:00
using System;
2022-09-30 16:33:06 +02:00
using Nefarius.Peripherals.SerialPort;
2012-03-03 10:50:54 +01:00
2022-10-03 02:27:27 +02:00
namespace PInvokeSerialPort.Sample;
internal class Program
2012-03-03 10:50:54 +01:00
{
2022-10-03 02:27:27 +02:00
private static void Main(string[] args)
2012-03-03 10:50:54 +01:00
{
2022-10-03 02:27:27 +02:00
var serialPort = new SerialPort("COM7") { UseRts = HsOutput.Online };
serialPort.DataReceived += x => Console.Write((char)x);
serialPort.Open();
serialPort.Write("START\r\n");
Console.ReadKey();
2012-03-03 10:50:54 +01:00
}
2022-09-30 16:33:06 +02:00
}