public static void SetStroboscope(byte value, bool writeImmediately)
 {
     OpenDMX.setDmxValue(GetChannel(SECTIONS_P4.STROBE), value);
     if (writeImmediately)
     {
         OpenDMX.writeData();
     }
 }
 public static void SetMasterFader(byte value, bool writeImmediately)
 {
     OpenDMX.setDmxValue(GetChannel(SECTIONS_P4.MASTER), value);
     if (writeImmediately)
     {
         OpenDMX.writeData();
     }
 }
 public static void SetAllOff(bool writeImmediately)
 {
     for (int i = 0; i < 26; i++)
     {
         OpenDMX.setDmxValue(i, 0);
     }
     if (writeImmediately)
     {
         OpenDMX.writeData();
     }
 }
        /// <summary>
        ///  Calculates which ledbar has to be active
        ///  Sets the channels of this bar on to maxValue
        /// </summary>
        /// <param name="v"></param>
        public static void SetKnightRiderEffect(byte value)
        {
            int  amountLedBars   = 10;
            byte maxValue        = 255;
            int  channels        = 25;
            int  correction      = 1;
            int  activeLedBar    = ((value / maxValue) * 100) / amountLedBars;
            int  startingChannel = ((activeLedBar * channels) + correction);
            int  endChannel      = ((activeLedBar * channels) + correction + channels);

            for (int i = startingChannel; i < endChannel; i++)
            {
                OpenDMX.setDmxValue(i, maxValue);
            }
        }
        public static void SetAllSingleColor(RGB color, byte value, bool writeImmediately)
        {
            List <int> channels = GetAllColorChannels(color);

            for (int i = 1; i < ChannelCount() + 1; i++)
            {
                if (channels.Contains(i))
                {
                    OpenDMX.setDmxValue(i, value);
                }
                else if (i == GetChannel(SECTIONS_P4.STROBE) || i == GetChannel(SECTIONS_P4.MASTER))
                {
                    continue;
                }
                else
                {
                    OpenDMX.setDmxValue(i, 0);
                }
            }
            if (writeImmediately)
            {
                OpenDMX.writeData();
            }
        }
 public static void SendData()
 {
     OpenDMX.writeData();
 }
 public static void Init()
 {
     OpenDMX.start();
     SetAllOff(true);
 }