Skip to content

Commit

Permalink
change pen lifts
Browse files Browse the repository at this point in the history
  • Loading branch information
ejkaplan committed Mar 14, 2024
1 parent 23e71ef commit fc15aa3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
6 changes: 3 additions & 3 deletions elkplot/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ def plan_layer_proc(
class Device:
def __init__(
self,
pen_up_position: float = -50,
pen_down_position: float = -120,
pen_up_position: float = 0,
pen_down_position: float = -150,
pen_up_speed: float = 150,
pen_down_speed: float = 150,
pen_up_delay: int = 50,
Expand Down Expand Up @@ -227,7 +227,7 @@ def zero_position(self):
def read_position(self) -> tuple[float, float]:
"""Get the xy coordinates of the pen"""
response = self._command("QS")
self._readline()
self._readline() # Clear out the 'OK'
a, b = map(float, response.split(","))
a /= self.steps_per_unit
b /= self.steps_per_unit
Expand Down
2 changes: 1 addition & 1 deletion test/config.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
SKIP_RENDER_TESTS = False
SKIP_DRAWING_TESTS = True
SKIP_DRAWING_TESTS = False
17 changes: 17 additions & 0 deletions test/test_device.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import pytest
from elkplot import Device
import config

@pytest.mark.skipif(config.SKIP_DRAWING_TESTS, reason="skipping rendering tests")
def test_position():
d = Device()
print(d.read_position())


def main():
test_position()


if __name__ == "__main__":
main()

0 comments on commit fc15aa3

Please sign in to comment.