VernierST / godirect-py

A Python module for reading from Vernier Go Direct® Sensors using USB or BLE.
GNU General Public License v3.0
8 stars 9 forks source link

Allow collection rates faster than 20 Hz over USB #1

Closed stocktonkincade closed 4 years ago

stocktonkincade commented 5 years ago

Currently, sample intervals greater than ~50 ms (20 Hz) will work over USB (also BLE). However, calling device.start() with a value less than ~51 ms, will result in sample intervals closer to 100 ms. This is likely due to the godirect module having to do 2 reads to the underlying hidapi device before aggregating a full measurement packet and returning to the user. This is for hidapi (USB) only. A separate issue should be created for vernierpygatt, should that be requested.

stocktonkincade commented 4 years ago

This is closed, as user error. The failure is due to an assumption that each device.read will return only a single measurement for each enabled channel. However, the GDX hardware packs multiple measurements into each packet as the measurement rate increases. So, to avoid this problem, one must access the new measurements through sensor.values, rather than sensor.value. New examples will be provided in godirect-examples.