Hi.
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?
Done.
Sorry.
Not sure how to delete post.
AND
3
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;
BLYNK_WRITE(your_button_pin){
int value = param.asInt();
if( value==1 ){
longPush = true;
} else {
longPush = false;
}
};
void your_function_to_run(){
if(longPush){
//run your code
}
}