Hello, my project is to open the garage doors with the google voice assistant, my project works correctly with android.
But with Iphone IOS the buttons of the blynk app remain activated.
#include <SPI.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
SimpleTimer timer;
char auth[] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; //nodemcu test
char ssid[] = "SIDD";
char pass[] = "PASSW";
BLYNK_WRITE(V0)
{
int value = param.asInt(); // Get value as integer
if (value == 1)
{
digitalWrite(16, HIGH); // Set GPIO 16 HIGH
timer.setTimeout(500L, []() { // Run after 0.5 seconds second
digitalWrite(16, LOW); // Set Pin 16 LOW
Blynk.virtualWrite(V0, 0);
}); // END Timer Function
}
}
BLYNK_WRITE(V1)
{
int value = param.asInt(); // Get value as integer
if (value == 1)
{
digitalWrite(14, HIGH); // Set GPIO 14 HIGH
timer.setTimeout(500L, []() { // Run after 0.5 seconds second
digitalWrite(14, LOW); // Set Pin 14 LOW
Blynk.virtualWrite(V1, 0);
}); // END Timer Function
}
}
void setup() {
Serial.begin(115200);
pinMode(16, OUTPUT); //D4 is GPIO 16 (Cancello Grande RELE IN1)(RELAY BUTTON)
digitalWrite(16, LOW); // Set GPIO 16 HIGH
pinMode(14, OUTPUT); //D5 is GPIO 14 (Cancello Piccolo RELE IN2)(RELAY BUTTON)
digitalWrite(14, LOW); //Set GPIO 14 HIGH
Blynk.begin(auth, ssid, pass);
}
void loop() {
timer.run ();
Blynk.run();
}