bbcmicrobit / bbcmicrobit/micropython

feature/bug with button_a.get_presses() / button_a.was_pressed()

Open
#541 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
646
Forks
290
PR merge metrics
No merged PRs in 30d

Description

I achieve REPL using the program screen. When I break into a program by pressing control-C i have the option of giving my microbit a soft reboot by pressing control-D. the following 2 programs display behavior that i think is a bug using either of these listings and follow these steps to reproduce it.

[getpresses.py.txt](https://github.com/bbcmicrobit/micropython/files/2238867/getpresses.py.txt)
[waspressed.py.txt](https://github.com/bbcmicrobit/micropython/files/2238868/waspressed.py.txt)

flash and execute the script of choice
start REPL typing `screen /dev/ttyACM0 115200`
press control-C to break the program and get a >>> python prompt
press button A one or more times
press control-D to soft reboot the microbit

The button_a.was_pressed() / button_a.get_pressses() code executes

surely not when a microbit has had a soft reboot, the `was_pressed()` method should return False and `get_presses()` should return 0

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.