private void EnableBtn_Click(object sender, System.EventArgs e) { if (!axis.IsHomed) { try { axis.HomeStart(); EnableBtn.Text = "Toggle Servo"; } catch (System.Exception ex) { MessageBox.Show(ex.Message); } } else { try { axis.Enable(!axis.IsEnabled); } catch (System.Exception ex) { MessageBox.Show(ex.Message); } } }
private void btnHome_Click(object sender, EventArgs e) { if (axis != null) { try { axis.HomeStart(); checkHomedStatus = true; homeStart = DateTime.Now; DisplayStatus("Home started"); } catch (Exception ex) { DisplayError("Home error: " + ex.Message); } } }