Skip to content

Commit

Permalink
fixed address and added sleep()
Browse files Browse the repository at this point in the history
  • Loading branch information
SilasM2001 committed Jun 5, 2024
1 parent 4480251 commit 7f16e98
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion basil/HL/mercury.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def set_position(self, value, precision=100, address=None, wait=False):
logger.warning("Target not reached! Target: {target}, actual position: {pos}, precision: {pre}".format(target=value, pos=pos, pre=precision))

def move_relative(self, value, precision=100, address=None, wait=False):
target = self.get_position(address=1) + value
target = self.get_position(address) + value
self._write_command("MR%d" % value, address)
if wait is True:
pos = self._wait(address)
Expand All @@ -107,6 +107,7 @@ def _wait(self, address=None): # waits until motor stops moving
logger.debug("Moving! Starting position: {pos}".format(pos=self.get_position(address)))
done = False
while done is False:
time.sleep(0.1)
a = self.get_position(address)
time.sleep(1)
b = self.get_position(address)
Expand Down

0 comments on commit 7f16e98

Please sign in to comment.