From 330c61d1b8f8a1d01a69b4319c2272473856bb85 Mon Sep 17 00:00:00 2001 From: Brian Pugh Date: Thu, 11 Aug 2022 19:48:13 -0700 Subject: [PATCH] Add readme to multiple device example --- examples/08_multiple_devices/README.rst | 6 ++++++ examples/08_multiple_devices/main.py | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 examples/08_multiple_devices/README.rst diff --git a/examples/08_multiple_devices/README.rst b/examples/08_multiple_devices/README.rst new file mode 100644 index 0000000..fc7def7 --- /dev/null +++ b/examples/08_multiple_devices/README.rst @@ -0,0 +1,6 @@ +Example 08: Multiple Devices +============================ + +Belay can interact with multiple micropython boards on different ports. +Tasks and Threads can be decorated multiple times from different devices. +When executed, devices are executed in the order that they were decorated (bottom upwards). diff --git a/examples/08_multiple_devices/main.py b/examples/08_multiple_devices/main.py index 4b0f765..3373412 100644 --- a/examples/08_multiple_devices/main.py +++ b/examples/08_multiple_devices/main.py @@ -68,7 +68,7 @@ def read_temperature(): @device2.thread @device1.thread -def blink_thread(): +def blink_loop(): while True: set_led(True) time.sleep(0.5) @@ -76,4 +76,4 @@ def blink_thread(): time.sleep(0.5) -blink_thread() +blink_loop()