Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // OrtizOL - xCSw - http://ortizol.blogspot.com
- using System;
- using System.IO.Ports;
- namespace Receta.CSharp.R0520
- {
- public class EscrituraEnCom1
- {
- public static void Main()
- {
- Console.WriteLine(Environment.NewLine);
- // Creación de instancia `SerialPort`:
- using( SerialPort puerto = new SerialPort("COM1"))
- {
- // Propiedades del puerto COM1:
- puerto.BaudRate = 9600;
- puerto.Parity = Parity.None;
- puerto.ReadTimeout = 10;
- puerto.StopBits = StopBits.One;
- // Escribe cadena de caracteres en el puerto:
- puerto.Open();
- puerto.Write("Blog xCSw");
- Console.WriteLine("Se ha escrito en el puerto COM1.");
- }
- Console.WriteLine(Environment.NewLine);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement