Skip to content

buttons.attach does not work after a soft reset #52

Description

@hfmanson

this code works after the first start of micropython, pressing A prints 1 when pressed, 0 when released

def on_action_btn(pressed):
	print(pressed)

import buttons
buttons.attach(buttons.BTN_A, on_action_btn)

however after a soft reset (CTRL+D) this code does not work anymore. Problem when using Thonny which does a soft reset before running a script
However a machine.reset() instead of a machine.soft_reset() makes it work again

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions