Advertisement
Guest User

Untitled

a guest
Jul 10th, 2014
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.87 KB | None | 0 0
  1. using System;
  2. using System.Net;
  3. using System.Net.Sockets;
  4. using System.Threading;
  5. using Microsoft.SPOT;
  6. using Microsoft.SPOT.Hardware;
  7. using SecretLabs.NETMF.Hardware;
  8. using SecretLabs.NETMF.Hardware.Netduino;
  9. using System.IO.Ports;
  10.  
  11. namespace NetDCC
  12. {
  13.     public static class Program
  14.     {
  15.         public static void Main()
  16.         {
  17.             SerialPort1.Open();
  18.             while (true)
  19.             {
  20.                 SerialPort1.Write(comandoIdle, 0, comandoIdle.Length);    
  21.             }            
  22.         }
  23.         public static SerialPort SerialPort1 = new SerialPort("COM1", 19200, Parity.None, 8, StopBits.One);
  24.         public static SerialPort SerialPort2 = new SerialPort("COM2", 19200, Parity.None, 8, StopBits.One);
  25.         public static byte[] comandoIdle = new byte[] { 0x55, 0x55, 0x56, 0x55, 0xE6, 0xE6, 0xE6, 0xE6, 0xE6, 0x55, 0x55 };
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement