Notification repeat

I want the notification setting every 10 minutes

That’s nice :smiley: But we are not code monkeys on demand.

And we would like you to re-post your code with proper formatting… as directed in the instructions you needed to delete when posting this.

Blynk - FTFC

You can also search this forum for other topics about how others resolved the repeating, but timed, notification issue.

I’d take https://github.com/blynkkk/blynk-library/blob/master/examples/Widgets/PushNotification/PushNotification_Interval/PushNotification_Interval.ino as a starting point. :wink:

1 Like

/*************************************************************
Download latest Blynk library here:
https://github.com/blynkkk/blynk-library/releases/latest

Blynk is a platform with iOS and Android apps to control
Arduino, Raspberry Pi and the likes over the Internet.
You can easily build graphic interfaces for all your
projects by simply dragging and dropping widgets.

Downloads, docs, tutorials: http://www.blynk.cc
Sketch generator:           http://examples.blynk.cc
Blynk community:            http://community.blynk.cc
Follow us:                  http://www.fb.com/blynkapp
                            http://twitter.com/blynk_app

Blynk library is licensed under MIT license
This example code is in public domain.


Output any data on LCD widget!

App project setup:
LCD widget, switch to ADVANCED mode, select pin V1
*************************************************************/

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#define TRIGGERPIN D3
#define ECHOPIN D4
int A, B ;
#include <TimeLib.h>
#include <WidgetRTC.h>
unsigned int notified = 0;

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

// Your WiFi credentials.
// Set password to “” for open networks.
char ssid[] = “wifi”;
char pass[] = “28021999”;
BlynkTimer timer;

WidgetRTC rtc;

// Digital clock display of the time
void clockDisplay()
{
// You can call hour(), minute(), … at any time
// Please see Time library examples for details

String currentTime = String(hour()) + “:” + minute() + “:” + second();
String currentDate = String(day()) + “/” + month() + “/” + year();
Serial.print("Current time: “);
Serial.print(currentTime);
Serial.print(” ");
Serial.print(currentDate);
Serial.println();

// Send time to the App
Blynk.virtualWrite(V1, currentTime);
// Send date to the App
Blynk.virtualWrite(V2, currentDate);
}

void setup()
{
// Debug console
Serial.begin(9600);
pinMode(TRIGGERPIN, OUTPUT);
pinMode(ECHOPIN, INPUT);
Blynk.begin(auth, ssid, pass);
// You can also specify server:
//Blynk.begin(auth, ssid, pass, “blynk-cloud.com”, 8442);
//Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8442);

rtc.begin();

// Other Time library functions can be used, like:
// timeStatus(), setSyncInterval(interval)…
// Read more: http://www.pjrc.com/teensy/td_libs_Time.html

// Display digital clock every 10 seconds
timer.setInterval(1000L, clockDisplay);

A = 100;

}

void loop()
{

digitalWrite(TRIGGERPIN, LOW);
delayMicroseconds(3);

digitalWrite(TRIGGERPIN, HIGH);
delayMicroseconds(12);

digitalWrite(TRIGGERPIN, LOW);
int distance = pulseIn(ECHOPIN, HIGH);
distance = distance / 58;
B = A - distance;
Blynk.virtualWrite(V3, B);

Serial.print(B);
Serial.println(“Cm”);

if (B <= 49 && notified == 0){//c heck to see if flag is also set 

notified = 1;
Blynk.notify(“Blynk - jumlah pakan tidak mencukupi”);
}else if (B >= 50){// set higher than 50 …
notified = 0;

}

if (B >= 49 && notified == 0){//c heck to see if flag is also set 

notified = 1;
Blynk.notify(“Blynk - jumlah pakan sudah mencukupi”);

}else if (B <= 48){// set lower than 48 …
notified = 0;

}

Blynk.run();

delay(1000);

Blynk.run();
timer.run();

}

I want to set when the distance is above 50 cm then notification out and below the distance of 49 cm notification … coding above can be out notification but out continuously without pause when I want to go out one time only