GPS Trigger

Hello

can someone tell me if the code is so correct in the GPS trigger because the LED color in the blynk app does not change when I’m out of range bw within the range

#define BLYNK_PRINT Serial


#include <SPI.h>
#include <Fishino.h>
#include <BlynkSimpleFishino.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "YourAuthToken";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "YourNetworkName";
char pass[] = "YourPassword";

WidgetLED led6(V3);

BLYNK_WRITE(V5) {
  int state = param.asInt();
  if (state) {
      led6.on();
   Blynk.setProperty(V3, "color", "#FF00FF");
  } else {
      led6.on();
   Blynk.setProperty(V3, "color", "#3ADF00");
  }
}

void setup()
{
  // Debug console
  Serial.begin(9600);

  Blynk.begin(auth, ssid, pass);
}

void loop()
{
  Blynk.run();
}

the code seems ok for me.

  • what is “state” representing (v5)?
  • put some serial println near the led6.on lines in the if else conditions, to see if they actually get executed
  • if all the above are correct, try a simpler led function, just turn on the led in if and turn off in else. setproperty features is buggy sometimes…
    or just use a simple display widget with some text, for testing

hello does not work with the GPS trigger

#define BLYNK_PRINT Serial


#include <SoftwareSerial.h>
SoftwareSerial SwSerial(10, 11); // RX, TX
    
#include <BlynkSimpleSerialBLE.h>
#include <SoftwareSerial.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "768aee3d0c3a4e60bdc643fxxxxx";

SoftwareSerial SerialBLE(10, 11); // RX, TX


WidgetLCD lcd(V1);
BlynkTimer timer;

BLYNK_WRITE(V5) {
  int state = param.asInt();
  if (state) {
      digitalWrite(3, HIGH);
      Serial.println("LED an");
      lcd.clear();
      lcd.print(4,1, "Hello");

  } else {
      digitalWrite(3, LOW);
      Serial.println("LED aus");
      lcd.clear();
      lcd.print(4,1, "world");
  }
}
void setup()
{
  // Debug console
  Serial.begin(9600);
pinMode(3, OUTPUT);
  SerialBLE.begin(9600);
  Blynk.begin(SerialBLE, auth);

  Serial.println("Waiting for connections...");

}

void loop()
{
  Blynk.run();
  timer.run();
}

@markop formatting uses three backticks, not three commas :wink:

Blynk - FTFC

yes sorry :Grinsen: I still do not understand why it does not trigger the GPS trigger when you leave the area yes, for example, the Led on or off go

Maybe a BLE issue… might need server access? Try searching this forum for GPS Trigger… see if any other suggestions or examples work.

https://community.blynk.cc/search?q=gps%20trigger%20order%3Alatest