Save data from a sensor using a button

I am currently using a GrovePi distance sensor, I would like some ideas as I am new to this area. Would it be possible for me to save in a file to download, the data obtained by the sensor at a certain time? If so, could you tell me where to start?

thanks Gabriel

yes

I’d start by looking at flows.nodered.org and finding a node that can handle data from the sensor. wire that up to a debug to see what you get and then look at the file out to save all the data to a file.

When you have that working I’d move onto how to save it when you push a button, which could be an inject node or on a dashboard

this I already did, my sensor is already working, throwing information to a graph, there is a start and pause button, and a reset button. Now I would like to make the button to save data.

well it might have been worth mentioning that!

There are many ways to do it, for example…
You can add a change node into your flow to save the last value to a global variable.
Then in another flow have a button press pick up the global variable and save it to a file.

Sorry, I forgot to mention it. Do you have some example of this application? I’m really new in the IOT area

Sorry I don’t but you can read about Global Variables in the docs on the website, and theres lots of examples of dashboard buttons on flows.nodered.org

But the best way to learn, is by having a try yourself

i will have a try, thanks

Are the buttons physical buttons or buttons in the ui-dashboard?

button in the ui-dashboard

Ok, then follow the suggestions from @ukmoose - I just wanted to make sure it wasn’t a physical button.