Skip to content

Commit

Permalink
change wait_for_level to wait_for_value
Browse files Browse the repository at this point in the history
This change turned the tutorial usable on my PYNQ-Z2
  • Loading branch information
AlexisFetet committed Mar 18, 2023
1 parent 93ddd21 commit c6dec3e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/source/overlay_design_methodology/pynq_and_asyncio.rst
Expand Up @@ -161,8 +161,8 @@ GPIO Peripherals

User I/O peripherals can trigger interrupts when switches are toggled or buttons
are pressed. Both the :ref:`Button<pynq-lib-button>` and
:ref:`Switch<pynq-lib-switch>` classes have a function ``wait_for_level`` and a
coroutine ``wait_for_level_async`` which block until the corresponding button or
:ref:`Switch<pynq-lib-switch>` classes have a function ``wait_for_value`` and a
coroutine ``wait_for_value_async`` which block until the corresponding button or
switch has the specified value. This follows a convention throughout the pynq
package that that coroutines have an ``_async`` suffix.

Expand All @@ -178,9 +178,9 @@ is defined:
button = base.buttons[number]
led = base.leds[number]
while True:
await button.wait_for_level_async(1)
await button.wait_for_value_async(1)
led.on()
await button.wait_for_level_async(0)
await button.wait_for_value_async(0)
led.off()
Next add instances of the coroutine to the default event loop
Expand Down

0 comments on commit c6dec3e

Please sign in to comment.