Reference for Wiring version 1.0 Build 0100+ If you have a previous version, use the reference included with your software. If see any errors or have any comments, let us know.
| Class | Button |
||
|---|---|---|---|
| Name | pressHandler() |
||
| Examples | #include <Button.h> /* Wire like this: GND -----/ button ------ pin 12 */ Button button = Button(12,BUTTON_PULLUP_INTERNAL); void handleButtonPressEvents(Button &btn) { Serial.println("press"); digitalWrite(WLED,HIGH); } void setup() { Serial.begin(9800); pinMode(WLED,OUTPUT); button.pressHandler(handleButtonPressEvents); } void loop() { button.isPressed(); //update internal state /* Feel free to do your own processing here. The buttons will be handeled 'automagically' by the handler functions */ } |
||
| Description | Register a handler for presses on this button. | ||
| Syntax | pressHandler(handler) |
||
| Parameters |
|
||
| Returns | None | ||
| Usage | Application |

