.:[ a broken lcd ]:.

Just another console cowboy.
GnuPG Key ID: 0x18B4AA48
main site

Emails:
isomk .:[ at ]:. kyle isom net
brokenlcd .:[ at ]:. google mail

brokenLCD Labs: AVR

This blog is mostly tech rantings. If you know me, subscribe to my other blog for updates on my adventures.
Designed by Redfield. Icons by Cameron Hunt.

Arduino Pushbutton Library

Text

Just finished a pushbutton library that’s pretty easy to use -

pushbutton trigger(triggerPin, LOW);

declares a pushbutton named trigger on the pin named by the integer triggerPin; the pushbutton is declared as active low. Then, you can check whether trigger has been pressed using

if ( trigger.isPressed() ) { }

The library uses debouncing and internal resistors. An example sketch (that also uses the Ping library) is available at http://isomk.sdf.org/brokenlcd/labs/arduino/PingTest.pde

The library itself is available via my Arduino page (http://isomk.sdf.org/arduino.html) or via my github repo (http://github.com/brokenlcd/Arduino-Libraries).



February 17, 2010, 4:34am