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

Using the left and right buttons? #2

Open
LZ2DMV opened this issue Sep 20, 2021 · 2 comments
Open

Using the left and right buttons? #2

LZ2DMV opened this issue Sep 20, 2021 · 2 comments

Comments

@LZ2DMV
Copy link

LZ2DMV commented Sep 20, 2021

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.

@WiFiFucker
Copy link

Sir GPIO16 (D0) is the one pin that is not suitable for buttons. :) It can be used as an output only and has the special role of sending a wakeup signal during deepsleep.

I find this web page handy as a reference for stuff like this: ESP8266 Pinout Reference: Which GPIO pins should you use? | Random Nerd Tutorials

You can add a resistor to fix this :)

@LZ2DMV
Copy link
Author

LZ2DMV commented Nov 7, 2021

Yes, i see.

It is probably a good idea for @spacehuhn to correct that in the PCB design.

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

2 participants