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

Default input pin is not pulled high #2

Open
myhd opened this issue Mar 27, 2021 · 5 comments
Open

Default input pin is not pulled high #2

myhd opened this issue Mar 27, 2021 · 5 comments
Labels

Comments

@myhd
Copy link
Contributor

myhd commented Mar 27, 2021

The default pin PCINT3 in config.h is not pulled high, leading to floating states with a switch.

Even if this appears trivial, can you add an option to pull high the input pin? Currently, I am resorting to a 30k resistor.

(This repo is wonderful. Thank you for it. I happen to use it for the reason you created it in the first place.)

@jasonmhite
Copy link
Owner

Sure thing, I probably should have done that originally.

My AVR programming setup is in a box somewhere so I am not able to test, do you want to just do it and I can merge it in?

@jasonmhite jasonmhite added the bug label Mar 27, 2021
@myhd
Copy link
Contributor Author

myhd commented Mar 28, 2021

Thank your for your trust. I come from the Arduino universe, pure C is not my strength (yet). I have no idea how to do it. I can wait until you find your AVR setup.

@jasonmhite
Copy link
Owner

jasonmhite commented Mar 29, 2021 via email

@myhd
Copy link
Contributor Author

myhd commented Mar 29, 2021

I think it's only a one line change, I'll double check and add it then maybe you can test it? Sounds like you have a 'tiny handy.

Yes I can, and yes I do!

@jasonmhite
Copy link
Owner

jasonmhite commented Mar 29, 2021

This is a note for myself, I'll add it in a branch and then you can try it out.

In main, should just need to add sbi(PORTB, INPUT_PIN); before the while while loop and wrap it in an ifdef. According to the datasheet, setting the appropriate bit in PORTB when the corresponding pin is set up in DDRB for input mode should activate the internal pullup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants