示例#1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            int input;

            input = PortInterop.Input(889);
            if (input == 225)
            {
                Button1.Text = "ON";
            }
            else
            {
                Button1.Text = "OFF";
            }
        }
示例#2
0
 private void Button1_Click(object sender, EventArgs e)
 {
     if (Button1.Text == "OFF")
     {
         //Turn The Circuit ON
         PortInterop.Output(888, 255);
         Button1.Text = "ON";
     }
     else
     {
         //Turn The Circuit OFF
         PortInterop.Output(888, 0);
         Button1.Text = "OFF";
     }
 }
示例#3
0
        private void Button1_Click(object sender, EventArgs e)
        {
            int output = 0;

            if (cbx1.Checked)
            {
                output += 1;
            }

            if (cbx2.Checked)
            {
                output += 2;
            }

            if (cbx3.Checked)
            {
                output += 4;
            }

            if (cbx4.Checked)
            {
                output += 8;
            }

            if (cbx5.Checked)
            {
                output += 16;
            }

            if (cbx6.Checked)
            {
                output += 32;
            }

            if (cbx7.Checked)
            {
                output += 64;
            }

            if (cbx8.Checked)
            {
                output += 128;
            }

            PortInterop.Output(888, output);
        }