Using Buttons.h Library with pull down buttons

Hi Guys n Gals,

I'm using the buttons.h library (http://www.arduino.cc/playground/Code/Buttons) in a sketch for a small timer. It works great.

The trouble is that the library only works with pull up buttons, so you have to use separate pull down resistors on each input. I'd like to avoid using the pull down resistors in my circuit as we will be 'mass' producing a bunch of these circuits. Using the internal pull-up resistor in the Arduino saves us time and money.

How would one use the buttons.h library with pull down buttons?

I did find a post on the old forums (http://arduino.cc/forum/index.php/topic,13600.msg101391.html#msg101391) about a 'patch' to do this very thing, but the patch did not work for me.

Any help would be greatly appreciated!

Thanks!

Ed

Could I use the internal pull up on the input, and make a variable the opposite of the input? Then run the button assignment off that variable? Would that work? ...not sure how to do that.

? :)

Yep that would work. I think there are weak pullups on the inputs by default. XD