![]() |
Phyphox editor Button send single value - Printable Version +- phyphox Forums (https://phyphox.org/forums) +-- Forum: App-Feedback (https://phyphox.org/forums/forumdisplay.php?fid=6) +--- Forum: Feature requests (https://phyphox.org/forums/forumdisplay.php?fid=8) +--- Thread: Phyphox editor Button send single value (/showthread.php?tid=1640) |
Phyphox editor Button send single value - vcbz - 10-21-2022 I am testing the button functionality. Is it possible that when you click the button it sends a value only once. I tried creating a button that sends a value to a BLE Characteristic but the value is sent continously. Is there an example (xml) of how to send a value only once when the button is pressed? RE: Phyphox editor Button send single value - Dominik Dorsel - 10-21-2022 Hey, unfortunately there is no simple way right now (its already on our todo list). As a workaround you can do it this way:
Hope this is not too confusing ![]() Cheers Dominik RE: Phyphox editor Button send single value - vcbz - 10-22-2022 Thanks for the example so if I understand correctly the value I have circled in blue has to be the same on the following image: And then the "Action1" is the value I can send a singleshot (e.g. 100 or 200 for this picture) ![]() RE: Phyphox editor Button send single value - Jens Noriʇzsɔɥ - 10-27-2022 Dominik is currently busy with a … sort-of other hardware project, so I try to get the answer right: First, please be careful with ordering the boxes in the analysis tab: they are processed from left to right (and in addition the editor complains that it does not entirely support Dominik's file, see the if element documentation)… Judging from the if element the “1”s in the button elements can by anything but “0”. The “1” in the middle append element is part of the communication with the microcontroller and its meaning is defined there, so it has –just reading the .phyphox file– nothing to do with the previous “1”s. Note that in your image this append element would be processed after the if block and, accordingly, it would not stop bluetooth communication. Same holds for the left append element: you should place it right of the if element (so that it is put below it in the .phyphox file) or the reset would not work… RE: Phyphox editor Button send single value - vcbz - 10-27-2022 Thanks for the answer. After struggling to use the editor (due to the multiple inputs warning) I managed to make it work for my experiment. I couldnt replicate this in the editor but had to copy fragmens of the xml provided by Dominik to make it work. I think this still would be a nice feature as currently it took me a while to understand how to use the button for my use case. Thanks and best regards. RE: Phyphox editor Button send single value - Jens Noriʇzsɔɥ - 10-27-2022 (10-27-2022, 05:26 PM)vcbz Wrote: I think this still would be a nice feature as currently it took me a while to understand how to use the button for my use case. Indeed. Unfortunately one of many… ![]() For the moment, it appears more likely that our new editor is ready. RE: Phyphox editor Button send single value - Huib - 12-12-2022 (10-27-2022, 05:26 PM)vcbz Wrote: Thanks for the answer. After struggling to use the editor (due to the multiple inputs warning) I managed to make it work for my experiment. I couldnt replicate this in the editor but had to copy fragmens of the xml provided by Dominik to make it work. Hi, I also want to do the same, send different values one time with the use of the edit but can't make it work in the editor. Also with the xml I am struggling so if you could help me out which lines are of interest in the xml it would help me a lot! RE: Phyphox editor Button send single value - Jens Noriʇzsɔɥ - 12-14-2022 The relevant parts are the four “button” elements and the three elements at the end of the analysis part: “append”, “if”, and “append”. The first “append” fills the BLE data, the “if” erases this data unless a button is pressed, and the second “append” resets the button press indicator (these elements are documented in our wiki at “Analysis modules”). Of course, you also need to define the corresponding containers and the output “bluetooth” element… |