Referencia para la versión de Wiring 1.0 Build 0100+. Si tiene una versión previa, use la referencia incluida con su software. Si encuentra errores o tiene comentarios, no dude en contactarnos.
| Clase | Button |
||
|---|---|---|---|
| Nombre | clickHandler() |
||
| Ejemplos | #include <Button.h> /* Wire like this: GND -----/ button ------ pin 12 */ Button button = Button(12,BUTTON_PULLUP_INTERNAL); void handleButtonClickEvents(Button & btn) { Serial.println("click"); digitalWrite(WLED, LOW); delay(200); digitalWrite(WLED, HIGH); delay(200); digitalWrite(WLED, LOW); delay(200); } void setup() { Serial.begin(9800); pinMode(WLED,OUTPUT); button.clickHandler(handleButtonClickEvents); } 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 */ } |
||
| Descripción | Define una función que será llamada cuando se haga click en el botón. | ||
| Sintaxis | clickHandler(handler) |
||
| Parámetros |
|
||
| Retorna | Ninguno | ||
| Uso | Application |

