well, intuitively it should take one action:
if button is short pressed do this
if button is long pressed do that
this is how it works on every phone or device.
i would measure the time between if(param.asInt(), and if(!param.asInt()
and:
if the measured time is lower than xxxx millis, it is a short click:
invoke void shortClick()
if millis longer than xxxx millis, invoke void longClick()
yes, but this is how things work. otherwise it can not decide if it is a long press or short, it has to wait to see check on your phone keyboard. until you not release a button, it will not write a letter.
I have to head to work but please update the code with changes to the issues you listed. I think snippets of code like this will be very benefitial to new Blynkers trying to work out SimpleTimer
If you want to help keep this thread clean, PM me the code and ill update my post
Yeah sure does very well and probs because of this explanation in your attachment. If the switch is moving from one state to another and staying there it becomes irrelevant as he describes here …
because of this if I can manage to use my existing two way wiring at the wall switch, back to the arduino, I will re-wire it all to use 5v logic the switch then just hard toggles the data pin to either logic 1 or 0 and the blynk app does the same.
So I guess a latching switch is the solution unless you need to use a momentary one for other functions ie long hold etc
true.
the inconvenience i see with this, is that unlike buttons, switches can stay in 2 positions, and you never know when it is “on” or “off” the light. this can be surprise for a person who is not get used with the system
very easy indeed which is why my vrbls have a 1 after them just duplicate everything ie RELAY2_PIN AC_Sens2_pin etc etc but within the same void loops ie AC_detect etc
hope that makes sense - I am using 9 channels when I implement this
@Khatrichaitanya As I have already asked twice, I moved your 4 channel code into your own post and removed your posting in the two other topics you had interjected into.
Please use your own topic to request any assistances. Thank you.