INPUT_PULLDOWN was not declared in this scope
troglodisme opened this issue · 1 comments
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.
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.)