コード例 #1
0
ファイル: Lib.cs プロジェクト: SchawnnDev/DmxApp
        public void TurnLightsOn()
        {
            //connect to controller if not connected
            ConnectToController();
            Guid queueId = Guid.Empty;
            //queues allow you to segregate events that run in parallel; use Guid.Empty for the shared queue
            //when all effects on a given queue ID (other than Empty) are complete, the queue is deleted
            //and those channels return to off.
            //the Guid.Empty queue is never deleted so allows you set permanent state
            int priority = 1;
            //priority allows you to control the order in which parallel queues are stacked

            //create a random helper
            Random random = new Random();
            //pick a random channel number (note some lights such as DMX RGB lights, smoke machines) etc.
            //require multiple channels to turn the light on
            //for example rgbwae lights have a base address which you set on the back of the light
            //which is RED then you have GREEN, BLUE, WHITE, AMBER, LUMA/BRIGHTNESS, EFFECTS
            //to set the light to aqua, you need to set Base+1 [Green], Base+2 [Blue] and Base+5 [Luma] to 255
            // int channel = random.Next(0, 512);
            int channel = 0;
            //set value to 255 (full on)
            byte channelValue = 18;

            //call the controller to set the value on the queue; this is a permanent set (will stay until you change it)
            DmxController <DMXProUSB> .SetDmxValue(queue : queueId, channel : channel, priority : priority, value : channelValue);
        }
コード例 #2
0
ファイル: Lib.cs プロジェクト: SchawnnDev/DmxApp
 public void SetDmxValue(Guid queueId, DmxValue value, int priority)
 {
     DmxController <DMXProUSB> .SetDmxValue(queueId, value.Channel.Value, priority, value.Value);
 }