VernierST / godirect-examples

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

Python examples drop points at faster sampling rates #23

Closed stocktonkincade closed 3 years ago

stocktonkincade commented 4 years ago

Calls to gdx.read at sampling rates greater than 20 Hz results in missing data points. This is related to this issue in godirect-py, but the fix needs to be made in the gdx layer and new examples provided. The problem is that gdx.read only returns that last point from all measurements read from the device since the last call to gdx.read. There needs to be a new API that will return all the measurements read from the device since the last call to gdx.read.

stocktonkincade commented 3 years ago

A new function in gdx.py sorts this out. The readValues() function will return a 2 dimensional array of active sensors and any samples that have been collected since the previous call to readValues().