Exemplo n.º 1
0
        private void btndutycycle_Click(object sender, EventArgs e)
        {
            parentindex = cmboxParent.SelectedIndex;
            if (chkalllamps.Checked)
            {
                data = Lamp.DimAll(byte.Parse(txtdutycycle.Text), parentindex + 1);
            }
            else
            {
                lampnumber = int.Parse(cmboxLamps.Text) - 1;
                data       = lamps[lampnumber].Dim(byte.Parse(txtdutycycle.Text));
            }
            if (!TTLport.IsOpen)
            {
                TTLport.Open();
            }

            if (chkallParents.Checked)
            {
                data[0] &= 0x3F;
            }
            TTLport.Write(data, 0, 2);
            TTLport.Close();
        }