(01-26-2023, 05:03 PM)Jens Noritzsch Wrote:Hi Jens,(01-26-2023, 03:23 PM)Mukund Wrote: Another question that popped in my mind, is it possible to create a custom experiment(using the editor tool/xml code) that includes a button to trigger the in-app graphical display while simultaneously sending the button state to the Arduino BLE device?
What do you mean by trigger: resetting a graph or tapping the “play” button? There is some discussion on sending button states inside tabs at https://phyphox.org/forums/showthread.php?tid=1640
I checked the link out and it seems like a good start to implement the button I wanted to.
For clarification on your question: I want the button to act as a way to reset/restart the graph(will have to check methods that clear the screen for the new graph to be displayed) and signal to the Arduino device that it's time to create a data buffer to be written to the SD-card. I want the user to be able to control each new "start" of the display and automate the SD-card writing simultaneously. The graphs would be displayed only for 5 minutes, post which Arduino would store the 5 minute data to the SD-card, stop sending data to the server and wait to listen to the next "button pressed" state.
Will try it out and let you know if I get stuck anywhere.
Thanks for the help!
(01-26-2023, 07:08 PM)Dominik Dorsel Wrote: Hey,Hey Dominik,
Jens got already a good starting point if I understand your question correctly. In case you dont know: It is possible to add an .phyphox file to your arduino sketch. Therefore you have to convert the .phyphox (or a zip file with one or multiple) file into an byte array and add it to the start function as we did in our CO2 project:
https://github.com/Dorsel89/phyphox-ardu...it.ino#L65 (check also line 75)
I know its ugly, but this way you can use all in phyphox available features and still store the experiment localy on your microcontroller without being limited by the library. If you dont know how to get the byte array you might want to take a look in the following java script (I know its ugly aswell, but since its rarely requested im too lazy to make a prober "public suitable" version).
https://github.com/Dorsel89/ZipFileToByteArray
Cheers
Dominik
Yes, I think Jen's recommendation might work, just need to quickly implement it and test it out.
Thanks for explaining how I could add the .phyphox file to the Arduino sketch, I was a bit lost there.
I also checked the java script file and it seems good enough for me to generate the required byte array. Since we are prototyping with an IOT device right now, I do not mind an "ugly" solution to the problem(since most of our solutions are also ugly
![Tongue Tongue](https://phyphox.org/forums/images/smilies/tongue.png)
Thanks again for the prompt help!