private void btTurnOff_Click(object sender, EventArgs e) { wclWeDoHub Hub = GetHub(); wclWeDoRgbLight Rgb = FRobot.GetRgbDevice(Hub); if (Rgb != null) { Int32 Res = Rgb.SwitchOff(); if (Res != wclErrors.WCL_E_SUCCESS) { MessageBox.Show("Unable to switch LED off: 0x" + Res.ToString("X8")); } } }
private void BtTurnOff_Click(Object Sender, EventArgs e) { if (FRgb == null) { MessageBox.Show("Device is not attached"); } else { Int32 Res = FRgb.SwitchOff(); if (Res != wclErrors.WCL_E_SUCCESS) { MessageBox.Show("Unable to switch LED off: 0x" + Res.ToString("X8")); } } }