Skip to content

Commit

Permalink
Implement Home function for CNC and make Home button on gui effective
Browse files Browse the repository at this point in the history
  • Loading branch information
mmouchous-ledger committed Nov 14, 2023
1 parent e42803b commit 3f162ed
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pystages/cncrouter.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,3 +304,12 @@ def set_origin(self) -> str:
:return: The response of the CNC ('ok' if command has been submitted correctly).
"""
return self.send_receive("G92 X0 Y0 Z0")

def home(self):
"""
Sends a `$H` command. The stage responds a message `[MSG:Sleeping]` after `ok`.
Take caution for collisions before calling this method !
"""
self.send("$H")

2 changes: 2 additions & 0 deletions pystages/gui/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,5 @@ def bouton_moved(self):
def home(self):
if self.stage is None:
return

self.stage.home()

0 comments on commit 3f162ed

Please sign in to comment.