.longPress
DESCRIPTION
Change the value of what is consider to be a long press on a button. Default value is 3000 (3sec).
After pressing a button for more than 3sec and less then 6sec, the functions swTop,swBottom, and swRotary, will return 3.
That is a longPress.
Make sure the value of lcd.longPress is less then the value of lcd.longLongPress.
SYNTAX
lcd.longPress;
PARAMETERS
none.
Its not a function. Its a variable.So you set and get/set a value like any variable.
If you set lcd.longPress=5000;
RETURNS
none.
Its not a function. Its a variable.So you set and get/set a value like any variable.
If you set lcd.longPress=5000;
EXAMPLE
#include
#include
InvIoT_U1 lcd(A0, A1); void setup() { lcd.longPress=2000; lcd.print("PUSH A BUTTON FOR MORE THEN "); lcd.print(lcd.longPress); } void loop() { byte switchTopStatus = lcd.swTop(); byte switchBottomStatus = lcd.swBottom(); byte switchRotaryStatus = lcd.swRotary(); if ((switchRotaryStatus == SW_LONG_PRESS) || (switchBottomStatus == SW_LONG_PRESS) || (switchTopStatus == SW_LONG_PRESS)) { lcd.setBuzzer(20); lcd.clear(); lcd.print("A LONG PRESS"); delay(1000); lcd.clear(); lcd.print("PRESS AGAIN FOR MORE THEN "); lcd.print(lcd.longPress); } }
SEE ALSO
.longLongPress