aggiunto test ruote
This commit is contained in:
parent
6460ba1f76
commit
04c8b29749
2 changed files with 20 additions and 4 deletions
22
leo/ruote.py
22
leo/ruote.py
|
|
@ -2,11 +2,27 @@ from pybricks.parameters import Port, Stop
|
||||||
from pybricks.pupdevices import Motor
|
from pybricks.pupdevices import Motor
|
||||||
from pybricks.tools import wait
|
from pybricks.tools import wait
|
||||||
|
|
||||||
mDestra = Motor(Port.A)
|
mDestra = Motor(Port.F)
|
||||||
mSinistra = Motor(Port.B)
|
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()):
|
while not (mSinistra.done() and mDestra.done()):
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ target-version = "py313"
|
||||||
line-length = 88
|
line-length = 88
|
||||||
|
|
||||||
[tool.ruff.lint]
|
[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]
|
[tool.ruff.lint.mccabe]
|
||||||
max-complexity = 12
|
max-complexity = 12
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue