-
Notifications
You must be signed in to change notification settings - Fork 63
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
Posibility to specify pinmode on Atm_button #60
Comments
Hi Best, I could fairly easily add an input_mode argument to the begin() method, if that works for you. But Atm_button would still be 'active LOW'. Is that useful? You could also use Atm_digital instead, that class can handle active high inputs. Just call pinMode after initialization:
BTW: You just saved me 5 pulldown resistors on my current Teensy 3.5 project. :-) |
Hi,
Actually I'd need the button to be active HIGH... Thanks for pointing that
out. Yes I much prefer working on pull-down and high active to save
resistors.
Maybe an option to configure the active state would be also needed.
I'll have a look at atm_digital, to see if it has the features I need..
Such as debounce.
Thanks for the quick answer and good luck with your project!
…On Wed, Jan 2, 2019, 09:08 Tinkerspy ***@***.*** wrote:
Hi Best,
I could fairly easily add an input_mode argument to the begin() method, if
that works for you. But Atm_button would still be 'active LOW'. Is that
useful?
You could also use Atm_digital instead, that class can handle active high
inputs. Just call pinMode after initialization:
Atm_digital button;
button.begin( 3, 20, true, true );
.onChange( led, led.EVT_TOGGLE );
pinMode( 3, INPUT_PULLDOWN );
BTW: You just saved me 5 pulldown resistors on my current Teensy 3.5
project. :-)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#60 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEqp31diV9xFbmZyq033rgAuhcCDOPo5ks5u_GjygaJpZM4ZmFiB>
.
|
It's got debounce, just the fancier stuff like longpress, repeat & autopress are missing. |
Seems good then, I'll try that way.
Just curious... Saved 5 resistors, anything to do with a wearable? 😉
…On Wed, Jan 2, 2019, 09:16 Tinkerspy ***@***.*** wrote:
It's got debounce, just the fancier stuff like longpress, repeat &
autopress are missing.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#60 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEqp35xjJebAsU3rRQWJo5XArxfOm0-eks5u_GrggaJpZM4ZmFiB>
.
|
No, a pinball machine. Not very wearable ;-) |
Nice! I'd love to see its tutorial for the automaton part 😉
…On Wed, Jan 2, 2019, 13:49 Tinkerspy ***@***.*** wrote:
No, a pinball machine. Not very wearable ;-)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#60 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEqp36VP3jlzuHOc8nhFrh-VRtefgkokks5u_Kr0gaJpZM4ZmFiB>
.
|
I just realized I'm also in need of this (I have a button that must be active-high since it also toggles something else), but I also need longpress, so I can't use digital. I guess you could add In general, adding more arguments to |
OK, that sounds like a plan. I made a branch with the new pinMode() & active() methods. Note that they must be called after begin(). Would you mind checking it out and testing it? button.begin( 13 )
.pinMode( INPUT_PULLDOWN )
.active( LOW )
.onPress( led, led.EVT_ON ); The branch is here |
Hey @tinkerspy ! |
I added this in fork https://github.com/sjernigan/Automaton and put in a PR |
Hi,
I'm currently evaluating your framework to try it out on a Cortex M0 and an ESP32, both of which have INPUT_PULLDOWN capabilities (which is more suitable to my project).
I'll quickly hack it locally as my time is limited, but maybe you would consider extending Atm_button to provide an extra parameter for the PINMODE, for a minor update?
Best
The text was updated successfully, but these errors were encountered: