Exemple #1
0
        private void DigitalTImer_Tick(object sender, EventArgs e)
        {
            digit.Connect_port0_read(ref ErrorMsg);
            digit.Connect_port1_write();

            /*if (ErrorMsg != null)
             * {
             *  DigitalTImer.Enabled = false;
             * }*/
            digit.port1_Output(0, true, ref ErrorMsg);
            digit.port1_Output(1, true, ref ErrorMsg);
            digit.port1_Output(2, true, ref ErrorMsg);
            digit.port1_Output(3, false, ref ErrorMsg);

            state = digit.port0_Input(ref ErrorMsg);

            myledbulb1.On = state[0];
            myledbulb2.On = state[1];
            myledbulb3.On = state[2];
            myledbulb4.On = state[3];
            myledbulb5.On = state[4];
            myledbulb6.On = state[5];
            myledbulb7.On = state[6];
            myledbulb8.On = state[7];
        }
Exemple #2
0
        private void buttonNum_Click(object sender, EventArgs e)
        {
            state = new bool[8];
            Button b = (Button)sender;

            digit.Segment(Convert.ToInt32(b.Tag), state);

            digit.port1_Output(2, false, ref ErrorMsg);
            digit.port1_Output(2, true, ref ErrorMsg);

            checkBox1.Checked = state[0];
            checkBox2.Checked = state[1];
            checkBox3.Checked = state[2];
            checkBox4.Checked = state[3];
            checkBox5.Checked = state[4];
            checkBox6.Checked = state[5];
            checkBox7.Checked = state[6];
            checkBox8.Checked = state[7];
        }