Skip to content

EV3 button pressed hat sometimes misses button presses #1374

Open
@ericrosenbaum

Description

@ericrosenbaum

Expected Behavior

The when button pressed hat should trigger each time you press an EV3 button.

Actual Behavior

The hat often misses presses. It is easiest to see if you press the button quickly several times a row, with a stack like this:

screen shot 2018-07-18 at 11 13 57 am

For example, if I press the button quickly three times in a row, the pop sound will often play only once or twice.

Also, individual presses (especially brief presses, in which you press and then release quickly) are sometimes missed.

I would guess this is related to the fact that we are detecting presses by polling the button state, so if the press and release both happen between two polling events, we miss them completely. There is 150ms between polling requests currently (and every 3 seconds, there is 300ms between them, because of the device list request), which is enough time to both press and release a button. Not sure if we can make this interval shorter, though.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions