Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hfmanson opened this issue Dec 10, 2023 · 0 comments
Open

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

hfmanson opened this issue Dec 10, 2023 · 0 comments

Comments

@hfmanson
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant