Skip to content

Calls which wait block all other events #27

@martinohanlon

Description

@martinohanlon

Consider the following program:

from picozero import LED, Button

led = LED(1)
led.off()
button = Button(3)

def blink_2_times():
    led.blink(on_time=0.5, n=2, wait=True)

button.when_pressed = blink_2_times
button.when_released = led.off

The expected behaivour would be for the LED to blink twice, but as soon as button is released the LED should turn off.

In practice the LED will continue to blink until it has finished.

This issue affects all calls which use wait. It becomes more apparent functions like PWMBuzzer.play which wait by default and it isnt an explicit action by the user to set wait to True.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions