mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-11 17:14:41 +00:00
umath: Use umath for math.
Do this for all Powered Up examples.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from pybricks.hubs import CityHub
|
||||
from pybricks.parameters import Color
|
||||
from pybricks.tools import wait
|
||||
from math import sin, pi
|
||||
from umath import sin, pi
|
||||
|
||||
# Initialize the hub.
|
||||
hub = CityHub()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from pybricks.hubs import PrimeHub
|
||||
from pybricks.parameters import Color
|
||||
from pybricks.tools import wait
|
||||
from math import sin, pi
|
||||
from umath import sin, pi
|
||||
|
||||
# Initialize the hub.
|
||||
hub = PrimeHub()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
from pybricks.hubs import ExampleHub
|
||||
from pybricks.parameters import Color
|
||||
from pybricks.tools import wait
|
||||
from math import sin, pi
|
||||
from umath import sin, pi
|
||||
|
||||
# Initialize the hub.
|
||||
hub = ExampleHub()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from pybricks.hubs import TechnicHub
|
||||
from pybricks.parameters import Color
|
||||
from pybricks.tools import wait
|
||||
from math import sin, pi
|
||||
from umath import sin, pi
|
||||
|
||||
# Initialize the hub.
|
||||
hub = TechnicHub()
|
||||
|
||||
@@ -2,9 +2,7 @@ from pybricks.pupdevices import Light
|
||||
from pybricks.parameters import Port
|
||||
from pybricks.tools import wait, StopWatch
|
||||
|
||||
# The math module is part of standard MicroPython:
|
||||
# https://docs.micropython.org/en/latest/library/math.html
|
||||
from math import pi, cos
|
||||
from umath import pi, cos
|
||||
|
||||
# Initialize the light and a StopWatch.
|
||||
light = Light(Port.A)
|
||||
|
||||
@@ -2,9 +2,7 @@ from pybricks.pupdevices import UltrasonicSensor
|
||||
from pybricks.parameters import Port
|
||||
from pybricks.tools import wait, StopWatch
|
||||
|
||||
# The math module is part of standard MicroPython:
|
||||
# https://docs.micropython.org/en/latest/library/math.html
|
||||
from math import pi, sin
|
||||
from umath import pi, sin
|
||||
|
||||
# Initialize the sensor.
|
||||
eyes = UltrasonicSensor(Port.A)
|
||||
|
||||
Reference in New Issue
Block a user