Long push button

I want to set relay state on button push, the tricky part here is:

  • initialy relay state is 1
  • i want it to be 0 as long as im pushing blynk button
  • after i release it, relay state should become 1 again.

Im not sure how to implement reading of this long button push.

Any ideas?

Not sure how to delete post.

Please tell me how you dealt with a long press ??

@AND, create a bool variable and change it on button push. Then use function which checks your variable and run the code.

bool longPush = false;

  int value = param.asInt();
  if( value==1 ){
    longPush = true;
  } else {
    longPush = false;

void your_function_to_run(){
    //run your code