public void atualizaBits() { label1.Text = Convert.ToString(bits.getBits()); label2.Text = Convert.ToString(bits.getBits(), 2); label3.Text = Convert.ToString(bits.getBits(), 16).ToUpper(); picLampada1.Image = (bits.getBits(1)) ? BitaBitInterface.Properties.Resources.motor_on : BitaBitInterface.Properties.Resources.motor_off; picLampada2.Image = (bits.getBits(2)) ? BitaBitInterface.Properties.Resources.motor_on : BitaBitInterface.Properties.Resources.motor_off; picLampada3.Image = (bits.getBits(3)) ? BitaBitInterface.Properties.Resources.motor_on : BitaBitInterface.Properties.Resources.motor_off; picLampada4.Image = (bits.getBits(4)) ? BitaBitInterface.Properties.Resources.motor_on : BitaBitInterface.Properties.Resources.motor_off; picLampada5.Image = (bits.getBits(5)) ? BitaBitInterface.Properties.Resources.motor_on : BitaBitInterface.Properties.Resources.motor_off; picLampada6.Image = (bits.getBits(6)) ? BitaBitInterface.Properties.Resources.motor_on : BitaBitInterface.Properties.Resources.motor_off; picLampada7.Image = (bits.getBits(7)) ? BitaBitInterface.Properties.Resources.motor_on : BitaBitInterface.Properties.Resources.motor_off; picLampada8.Image = (bits.getBits(8)) ? BitaBitInterface.Properties.Resources.motor_on : BitaBitInterface.Properties.Resources.motor_off; radLamp1On.Checked = bits.getBits(1); radLamp2On.Checked = bits.getBits(2); radLamp3On.Checked = bits.getBits(3); radLamp4On.Checked = bits.getBits(4); radLamp5On.Checked = bits.getBits(5); radLamp6On.Checked = bits.getBits(6); radLamp7On.Checked = bits.getBits(7); radLamp8On.Checked = bits.getBits(8); radLamp1Off.Checked = !bits.getBits(1); radLamp2Off.Checked = !bits.getBits(2); radLamp3Off.Checked = !bits.getBits(3); radLamp4Off.Checked = !bits.getBits(4); radLamp5Off.Checked = !bits.getBits(5); radLamp6Off.Checked = !bits.getBits(6); radLamp7Off.Checked = !bits.getBits(7); radLamp8Off.Checked = !bits.getBits(8); }
private void button2_Click(object sender, EventArgs e) { label1.Text = Convert.ToString(bits.getBits()); label2.Text = Convert.ToString(bits.getBits(), 2); label3.Text = Convert.ToString(bits.getBits(), 16).ToUpper(); lblBit1.Text = (bits.getBits(1)) ? "1" : "0"; lblBit2.Text = (bits.getBits(2)) ? "1" : "0"; lblBit3.Text = (bits.getBits(3)) ? "1" : "0"; lblBit4.Text = (bits.getBits(4)) ? "1" : "0"; lblBit5.Text = (bits.getBits(5)) ? "1" : "0"; lblBit6.Text = (bits.getBits(6)) ? "1" : "0"; lblBit7.Text = (bits.getBits(7)) ? "1" : "0"; lblBit8.Text = (bits.getBits(8)) ? "1" : "0"; }