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

Button2 Class has no member getAttachPin #23

Closed
madivad opened this issue Feb 8, 2021 · 5 comments
Closed

Button2 Class has no member getAttachPin #23

madivad opened this issue Feb 8, 2021 · 5 comments

Comments

@madivad
Copy link

madivad commented Feb 8, 2021

I am referencing a sketch that uses Button2 and I was pointed to this repo, however there is an error I am getting about getAttachPin, in searching your code I see that it in fact doesn't appear.

I have found several sketches that reference this non-existant class member:

I am using your current master as of this date (1.5.3)

I am not sure where the error is, I can't see any member that returns a pin from the class. Is this something that other parties have created as an extension to your class? It's funny that several sketches refer to it

@LennartHennigs
Copy link
Owner

Hey,
you are correct in both instances – yes, there is no function like this in my class and yes, I did see a fork where lewisxhe implemented it.

Well, I never thought it was really needed, since you assign the pin in the constructor or in the begin() function and you most likely have the pin defined it as a constant or via a #define on the top of you sketch.

But I am could be convinced otherwise :-) Any thoughts on why it makes sense to have it?

Cheers
l.

@madivad
Copy link
Author

madivad commented Feb 8, 2021

I only just found the fork in the last few minutes, I'm working through some example code and I haven't got into the hows and whys yet.

I think in the cases I have seen it's been the fact that various buttons are mapped and they would want to be determining which button has activated the callback.

I was trying to rework the original code because I could see that's what they were trying to achieve, but this level of .cpp and callbacks and references is a little beyond my level of understanding.

@LennartHennigs
Copy link
Owner

Well, its a quick fix. I'll add it to the main branch and release it today.
Will close this when I push it.
Do you download the source from here or shall I make it a proper version and push it Arduino IDE/Platform.io as well?

@madivad
Copy link
Author

madivad commented Feb 8, 2021

I did download it through the Arduino IDE, I just edited the library file directly, so hopefully when the new version is pushed my manual edit will be replaced by yours, I'll check it myself later. Thanks for your quick and speedy response to this, it did have me pulling my hair out since my google fu was not finding the fork initially. I never even thought to check for that. Thanks again

@LennartHennigs
Copy link
Owner

created a new version and it wil be available through the Arduino IDE or here via download.

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