Hello,
I have a photon project which publishes an event(send an email) when I shake vibration sensor. I just want it detects the action of sensor once a day? What ways I can do?
Thanks
Hello,
I have a photon project which publishes an event(send an email) when I shake vibration sensor. I just want it detects the action of sensor once a day? What ways I can do?
Thanks
Use a timer perhaps? Look for SparkIntervalTimer library.
What you want to do seems straight forward if I’m understanding correctly. You want to detect vibrations but only transmit to IFTTT once per day. The quesitons I would have are:
Basically you’re doing something like this pseudo-code:
uint32_t lastPubTime = Time.now();
setup() {
}
loop() {
//Detect Vibrations if any.
//if there was a vibration, increment counter.
//Check if it is time to publish yet.
if (lastPublishTime + 24hours >= Time.now()) {
//Pulish to IFTTT
//Set lastPublishTime to Time.now().
}
}
Thank you so much,
I just use 1 vibration sensor to publish and use bool to check if it had sent already.
expect 24h like 00.00~23.59
I don’t need a specific time
I think it works with your solution.