mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-15 11:04:55 +00:00
all: ruff check --fix.
Mainly fixes and sorts imports.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from pybricks.pupdevices import ForceSensor
|
||||
from pybricks.parameters import Port
|
||||
from pybricks.pupdevices import ForceSensor
|
||||
from pybricks.tools import wait
|
||||
|
||||
# Initialize the sensor.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from pybricks.pupdevices import ForceSensor
|
||||
from pybricks.parameters import Port
|
||||
from pybricks.pupdevices import ForceSensor
|
||||
from pybricks.tools import wait
|
||||
|
||||
# Initialize the sensor.
|
||||
@@ -28,8 +28,7 @@ def wait_for_force():
|
||||
force = button.force()
|
||||
|
||||
# Update the maximum if the measured force is larger.
|
||||
if force > maximum:
|
||||
maximum = force
|
||||
maximum = max(maximum, force)
|
||||
|
||||
# Wait and then measure again.
|
||||
wait(10)
|
||||
@@ -42,4 +41,4 @@ def wait_for_force():
|
||||
# the peak force and repeat.
|
||||
while True:
|
||||
peak = wait_for_force()
|
||||
print("Released. Peak force: {0} N\n".format(peak))
|
||||
print(f"Released. Peak force: {peak} N\n")
|
||||
|
||||
Reference in New Issue
Block a user