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