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

INPUT_PULLDOWN was not declared in this scope #1

Open
troglodisme opened this issue Mar 10, 2020 · 1 comment
Open

INPUT_PULLDOWN was not declared in this scope #1

troglodisme opened this issue Mar 10, 2020 · 1 comment

Comments

@troglodisme
Copy link

I can't get the buttons to work, and I am getting the above error when compiling the Arduino Sketch for my Feather Bluefruit 32u4, which should be behaving similarly to your M0. Did you have change the core library to get pulldown to work?

Thanks

Arduino: 1.8.5 (Mac OS X), Board: "Adafruit Feather 32u4"

/var/folders/vq/m_0zjh4s4494zxphtq5bsy900000gn/T/arduino_modified_sketch_912751/buttons.ino: In function 'void setup()':
buttons:99: error: 'INPUT_PULLDOWN' was not declared in this scope
pinMode(p_btn1, INPUT_PULLDOWN);
^~~~~~~~~~~~~~
/var/folders/vq/m_0zjh4s4494zxphtq5bsy900000gn/T/arduino_modified_sketch_912751/buttons.ino:99:19: note: suggested alternative: 'INPUT_PULLUP'
pinMode(p_btn1, INPUT_PULLDOWN);
^~~~~~~~~~~~~~
INPUT_PULLUP
exit status 1
'INPUT_PULLDOWN' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

@frumperino
Copy link
Owner

frumperino commented Mar 11, 2020

I will look into this issue, but maybe the simplest solution is that I change the Buttons example to not even have the option to use common-high on the buttons, which was the reason for using the INPUT_PULLDOWN pin mode. It is as you noted, not available on all platforms.

So the quick fix is to just connect the common button wire (red) to GND and use INPUT_PULLUP, and delete the conditional guff around that block.

Let me know if this doesn't solve your problem; I'll go and update the examples later (I have created several additional ones showing use of scrolling text and such.)

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