diff --git a/leo/ruote.py b/leo/ruote.py index a47775f..79ffaa2 100644 --- a/leo/ruote.py +++ b/leo/ruote.py @@ -2,11 +2,27 @@ from pybricks.parameters import Port, Stop from pybricks.pupdevices import Motor from pybricks.tools import wait -mDestra = Motor(Port.A) +mDestra = Motor(Port.F) mSinistra = Motor(Port.B) -mSinistra.run_angle(1000, 360, then=Stop.HOLD, wait=False) -mDestra.run_angle(1000, 360, then=Stop.HOLD, wait=False) + +def vai_avanti(speed, gradi): + mSinistra.run_angle(speed, gradi, then=Stop.NONE, wait=False) + mDestra.run_angle(-speed, gradi, then=Stop.NONE, wait=False) + + +def turn(speed_L, speed_R, gradi): + mSinistra.run_angle(speed_L, gradi, then=Stop.NONE, wait=False) + mDestra.run_angle(speed_R, gradi, then=Stop.NONE, wait=False) + + +print("test1") +vai_avanti(1000, 360) +print("test2") +turn(1000, 1000, 360) +print("test3") +vai_avanti(1000, 360) +turn(1000, 1000, 360) while not (mSinistra.done() and mDestra.done()): diff --git a/pyproject.toml b/pyproject.toml index 763e356..5ff5445 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,7 @@ target-version = "py313" line-length = 88 [tool.ruff.lint] -extend-select = ["I", "UP", "N", "C"] # isort, pyupgrade, pep8-naming, mccabe +extend-select = ["I", "UP", "C"] # isort, pyupgrade, pep8-naming, mccabe [tool.ruff.lint.mccabe] max-complexity = 12