Skip to content

Using the left and right buttons? #2

@LZ2DMV

Description

@LZ2DMV

Hello,

How can i use the left and right buttons on my Hackheld Vega?

According to the board print, they are on D0 and D7, which are 16 and 13 microcontroller pins respectively.

I tried adding this to the Button block in A_config.h:

#define BUTTON_LEFT 16 // D0
#define BUTTON_RIGHT 13 // D7 

Then, using them in DisplayUI class:

void DisplayUI::setupButtons() {
(...)
leftBtn  = new ButtonPullup(BUTTON_LEFT);
rightBtn = new ButtonPullup(BUTTON_RIGHT);
(...)
// === BUTTON LEFT === //
leftBtn->setOnClicked([this]() {
scan.stop();
});

That doesn't work, though - nothing happens on button press.

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