VernierST / godirect-examples

Official examples for Vernier Go Direct® Sensors in both Python and JavaScript
BSD 3-Clause "New" or "Revised" License
24 stars 26 forks source link

gdx.start() with different period #49

Open mctosima opened 1 year ago

mctosima commented 1 year ago

Hi, I'm using the GoDirect Respiratory Belt and EKG. I want to use both in different periods (sampling rate). I want to use the ECG at 40hz while it cant because the Respiratory Belt only supports 20hz. Is there any way to do this?

My capture code

sswartley commented 1 year ago

Hello,

This does work using our Graphical Analysis app, so that is an option. That would be a way to get the data. But you are correct that our Python code is not able to handle this. I'm really not sure if you could dig into the Python code to get this to work. Sorry that I don't have any more insight into how this might work using our Python library.

All the best,

Sam

mctosima commented 1 year ago

Hi @sswartley, thanks for replying. I agree that we can do that using the graphical analysis app. Unfortunately, the main feature that I need is missing on the Graphical Analysis app, which is set the scheduler to start at a certain time. That's why I did this on Python.

As you clarify that this individual sampling rate isn't available on the python packages, for now, I'm using the ECG with a USB while the RB with a BLE, and triggers 2 different capture codes from the terminal. I think this is the only solution for now. Thank you.

You may close this issue or leave it opened.

sswartley commented 1 year ago

One thing that you might pursue is working with the godirect library directly, and not using the 'gdx' module. If you take a look at the examples you will find one that does not use the 'gdx' module. This example sends back the sensor values as a list. I do not know for sure, but maybe this example (modified to work with 2 Go Direct devices) handles one sensor sending back a list that has more values than the other sensor's list.