From a0e4ffdb5cddf525d9ab83f8a5e8db659a287174 Mon Sep 17 00:00:00 2001 From: Laurens Valk Date: Wed, 14 Jul 2021 09:55:17 +0200 Subject: [PATCH] umath: Use umath for math. Do this for all Powered Up examples. --- examples/pup/hub_cityhub/light_animate.py | 2 +- examples/pup/hub_primehub/light_animate.py | 2 +- examples/pup/hub_shared/light_animate.py | 2 +- examples/pup/hub_technichub/light_animate.py | 2 +- examples/pup/light/math.py | 4 +--- examples/pup/sensor_ultrasonic/math.py | 4 +--- 6 files changed, 6 insertions(+), 10 deletions(-) diff --git a/examples/pup/hub_cityhub/light_animate.py b/examples/pup/hub_cityhub/light_animate.py index 1a3303f..1a81a88 100644 --- a/examples/pup/hub_cityhub/light_animate.py +++ b/examples/pup/hub_cityhub/light_animate.py @@ -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() diff --git a/examples/pup/hub_primehub/light_animate.py b/examples/pup/hub_primehub/light_animate.py index eb31667..cb03ce5 100644 --- a/examples/pup/hub_primehub/light_animate.py +++ b/examples/pup/hub_primehub/light_animate.py @@ -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() diff --git a/examples/pup/hub_shared/light_animate.py b/examples/pup/hub_shared/light_animate.py index eb765ea..57af652 100644 --- a/examples/pup/hub_shared/light_animate.py +++ b/examples/pup/hub_shared/light_animate.py @@ -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() diff --git a/examples/pup/hub_technichub/light_animate.py b/examples/pup/hub_technichub/light_animate.py index 6cec097..f1ee530 100644 --- a/examples/pup/hub_technichub/light_animate.py +++ b/examples/pup/hub_technichub/light_animate.py @@ -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() diff --git a/examples/pup/light/math.py b/examples/pup/light/math.py index 459d32e..8fee4b6 100644 --- a/examples/pup/light/math.py +++ b/examples/pup/light/math.py @@ -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) diff --git a/examples/pup/sensor_ultrasonic/math.py b/examples/pup/sensor_ultrasonic/math.py index ff493b8..9e16602 100644 --- a/examples/pup/sensor_ultrasonic/math.py +++ b/examples/pup/sensor_ultrasonic/math.py @@ -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)