aggiunto test ruote

This commit is contained in:
leo 2025-09-21 18:09:49 +02:00
parent 6460ba1f76
commit 04c8b29749
2 changed files with 20 additions and 4 deletions

View file

@ -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()):

View file

@ -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