clickButton icon indicating copy to clipboard operation
clickButton copied to clipboard

Add user read function

Open bveenema opened this issue 6 years ago • 1 comments

Adds a new constructor in which a user defined function can be used read the pin. Useful if you need to read a button that is attached to an I/O expander.

bveenema avatar Feb 03 '19 20:02 bveenema

Example:

bool readButton(uint8_t pin){
  return IOExp.digitalRead(pin);
}
ClickButton Button(readButton, USER_BUTTON_IOEXP_PIN, LOW, 2);

bveenema avatar Feb 03 '19 20:02 bveenema