05-05-2020, 08:59 PM
Beautiful data and nicely done. It is great to see all these well-designed contributions.
To link data from sensors that are not synchronized, the following workaround helps with "slow" data rates like in this case:
Let both sensors write to a buffer of size 1 and set a sleep rate for the analysis process so that it is executed at approximately the rate that you would like to get. Then take the data from both buffers without deleting their content (disable the clear function) and append them to a larger buffer each. This way, you always append the latest value from both buffers and if one has a new value, it will be paired with copy of the old value from the other sensor as it is still in the buffer. You can also generate a matching time axis using the timer-module. A downside to this approach is that values may appear multiple times or might be missed - depending on how you choose your sleep-value compared to the sensor rate. But for this type of experiment this does not really matter.
In any case, I will bump "write a proper interpolation function" a bit further up on my todo list
One other note to anyone who wants to try this experiment:
You will not be able to do any experiment with a Bluetooth mouse on iOS. The iPhone filters the entire HID service and phyphox cannot even see that this device offers such a service. Similar to when the mouse is used as an actual cursor on Android, but it cannot be deactivated on iOS. Therefore it cannot be accessed from our generic BLE interface, but would require an explicit implementation for pointer devices.
To link data from sensors that are not synchronized, the following workaround helps with "slow" data rates like in this case:
Let both sensors write to a buffer of size 1 and set a sleep rate for the analysis process so that it is executed at approximately the rate that you would like to get. Then take the data from both buffers without deleting their content (disable the clear function) and append them to a larger buffer each. This way, you always append the latest value from both buffers and if one has a new value, it will be paired with copy of the old value from the other sensor as it is still in the buffer. You can also generate a matching time axis using the timer-module. A downside to this approach is that values may appear multiple times or might be missed - depending on how you choose your sleep-value compared to the sensor rate. But for this type of experiment this does not really matter.
In any case, I will bump "write a proper interpolation function" a bit further up on my todo list

One other note to anyone who wants to try this experiment:
You will not be able to do any experiment with a Bluetooth mouse on iOS. The iPhone filters the entire HID service and phyphox cannot even see that this device offers such a service. Similar to when the mouse is used as an actual cursor on Android, but it cannot be deactivated on iOS. Therefore it cannot be accessed from our generic BLE interface, but would require an explicit implementation for pointer devices.