private void WireupOutput(int index) { this.DigitalOutputs[index] = new PhysicalDevice.DigitalOutput(x => { SendSerialCommand(string.Format("O,{0},{1}", index + 1, x ? 1 : 0)); }); }