Virtual Digital PIn hisotry (momentary digital used for switching)

I have seen the history graph and similar, but they appear to be monitoring either analog signals or digital pins that stay high or low for periods of time. As in they monitor for short periods at defined time steps/intervals.

I am looking into using a physical switch (on a digital pin on the arduino) that makes a virtual pin change value momentarily, using a command like this ‘Blynk.virtualWrite(V10, “1”)’; followed by a small delay and then reset the virtual pin back to zero ‘Blynk.virtualWrite(V10, “0”);’

Can I get a history of when V10 went high? I don’t even need a graph, just a time stamp of then the button wash pushed that made the virtual pin go momentarily high without having the app open (so on the Blynk server I assume)

You can have all the timestamps sent to you via email, PUSH or SMS as the event occurs.

Would this do or do you want a “database” of timestamps?

How accurate does it need to be (within a minute, a second or millisecond etc) and how often will the condition be met?

If 1 minute accuracy is OK you can write a 1 to a “dummy” virtual pin and keep it at 1 for at least a minute then simply request data for this virtual pin with the API. The csv is provides comes automatically with timestamps.

This will only work if normally the condition is only met at 1 minute frequencies and higher.

Holding the virtual pin high for 1 minute or 2 is fine as long as I write it so it’s not a delay for 1 minute that holds up other processes.

Accuracy can be up to 10 minute periods really, just need an idea of how many times during the day the button is pushed, with each push being a minimum of 1 hour apart (due to my code not allowing frequent button pushes).

I only have wifi on the board, so assume sms is not an option really huh. I am happy with an email, although a summary email of the day would be better… Although may be harder to implement.

What it is, is a treat dispenser for my dog. I have the code timed so that a light will come on every few hours and if he works out to push the foot pedal when the light is on then treats are dispensed. So I want to get an idea of how frequent he pushes the switch (which can’t be more often than the light coming on).

You just use “timers” and they don’t halt the sketch.

You have a smartphone in a addition to the MCU, SMS is sent to the Smartphone (as are email and PUSH messages).

When you need to see the data (hourly, daily, weekly) you simply make the API call.

You could also send the timestamps to Terminal and Table widgets.

Thanks. I have decided to send an email each time the button is pushed and this appears to work well. Time stamp is accurate enough and shouldn’t add any battery drain seeing I have email on push anyway.