summaryrefslogtreecommitdiffstatshomepage
path: root/examples/hwapi
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2022-08-19 22:58:37 +1000
committerJim Mussared <jim.mussared@gmail.com>2023-06-08 17:54:24 +1000
commit5fd042e7d1610b4d42acfc523441468f2ac28c6f (patch)
tree87903a5cec5409b89f38fa7d0809d80ca7b127d5 /examples/hwapi
parent9d7eac07138b6e02f4c0775dc70f36fdd69432a2 (diff)
downloadmicropython-5fd042e7d1610b4d42acfc523441468f2ac28c6f.tar.gz
micropython-5fd042e7d1610b4d42acfc523441468f2ac28c6f.zip
all: Replace all uses of umodule in Python code.
Applies to drivers/examples/extmod/port-modules/tools. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'examples/hwapi')
-rw-r--r--examples/hwapi/README.md6
-rw-r--r--examples/hwapi/button_led.py4
-rw-r--r--examples/hwapi/button_reaction.py4
-rw-r--r--examples/hwapi/soft_pwm.py6
4 files changed, 10 insertions, 10 deletions
diff --git a/examples/hwapi/README.md b/examples/hwapi/README.md
index f3de752f9c..a1b0c5642a 100644
--- a/examples/hwapi/README.md
+++ b/examples/hwapi/README.md
@@ -40,13 +40,13 @@ application of this idea would look like:
`app.py`:
from hwconfig import *
- import utime
+ import time
while True:
LED.value(1)
- utime.sleep_ms(500)
+ time.sleep_ms(500)
LED.value(0)
- utime.sleep_ms(500)
+ time.sleep_ms(500)
To deploy this application to a particular board, a user will need:
diff --git a/examples/hwapi/button_led.py b/examples/hwapi/button_led.py
index bd6fe01729..c73bcfc89a 100644
--- a/examples/hwapi/button_led.py
+++ b/examples/hwapi/button_led.py
@@ -1,4 +1,4 @@
-import utime
+import time
from hwconfig import LED, BUTTON
# Light LED when (and while) a BUTTON is pressed
@@ -6,4 +6,4 @@ from hwconfig import LED, BUTTON
while 1:
LED.value(BUTTON.value())
# Don't burn CPU
- utime.sleep_ms(10)
+ time.sleep_ms(10)
diff --git a/examples/hwapi/button_reaction.py b/examples/hwapi/button_reaction.py
index e5a139a575..52bdf79384 100644
--- a/examples/hwapi/button_reaction.py
+++ b/examples/hwapi/button_reaction.py
@@ -1,4 +1,4 @@
-import utime
+import time
import machine
from hwconfig import LED, BUTTON
@@ -18,4 +18,4 @@ while 1:
print("Well, you're *really* slow")
else:
print("You are as slow as %d microseconds!" % delay)
- utime.sleep_ms(10)
+ time.sleep_ms(10)
diff --git a/examples/hwapi/soft_pwm.py b/examples/hwapi/soft_pwm.py
index 72291b0ecd..466de08f09 100644
--- a/examples/hwapi/soft_pwm.py
+++ b/examples/hwapi/soft_pwm.py
@@ -1,4 +1,4 @@
-import utime
+import time
from hwconfig import LED
@@ -15,10 +15,10 @@ def pwm_cycle(led, duty, cycles):
for i in range(cycles):
if duty:
led.on()
- utime.sleep_ms(duty)
+ time.sleep_ms(duty)
if duty_off:
led.off()
- utime.sleep_ms(duty_off)
+ time.sleep_ms(duty_off)
# At the duty setting of 1, an LED is still pretty bright, then