Skip to content

display.clear() does not stop display.show(loop=True, wait=False) #150

Closed
@microbit-carlos

Description

@microbit-carlos

Reported in the V1 repository, but I think it's actually a V2 only issue:

With this programme pressing button A should stop the animation looping forever by using display.clear(), but it only clears the current image displayed and the next animation steps continue.

Pressing B replaces the animation by just displaying a letter and at that point display.clear() works as expected.

from microbit import *

display.show("hello", loop=True, wait=False)
while True:
    sleep(100)
    if button_a.is_pressed():
        display.clear()
    if button_b.is_pressed():
        display.show("X")

In V1 display.clear() does stop the animation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions