コード例 #1
0
    void SendDummyData()
    {
        var packet = new ArtnetDmx(0);

        packet.setChannel(channel, value);
        msgBytes       = packet.toBytes();
        pendingMessage = true;
    }
コード例 #2
0
ファイル: test.cs プロジェクト: rudxde/cs-artnet-dmx
    public static void Main()
    {
        socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
        toAddr = new IPEndPoint(IPAddress.Parse("10.1.255.220"), 6454);

        // create a new ArtNet Packet for Universe 1
        packet = new ArtnetDmx(1);

        //PrintByteArray(packet.toBytes());

        /*
         * packet.setChannel(0, 20);
         * packet.setChannel(1, 20);
         * packet.setChannel(2, 20);
         * packet.setChannel(3, 20);
         * packet.setChannel(4, 20);
         * packet.setChannel(5, 20);
         * packet.setChannel(6, 20);
         * packet.setChannel(7, 20);
         * packet.setChannel(8, 20);
         * packet.setChannel(9, 20);
         * packet.setChannel(10, 20);
         * packet.setChannel(11, 20);
         * packet.setChannel(12, 20);
         * socket.SendTo(packet.toBytes(), toAddr);
         */


        directions = new bool[512];

        // LED PAR 1
        directions[10] = true;
        directions[11] = false;
        directions[12] = true;

        Timer timer = new Timer(3);

        timer.Elapsed += TimerEvent;
        timer.Start();

        Console.WriteLine("Press any key to exit... ");
        Console.ReadKey();
    }