adafruit / Adafruit_CircuitPython_ADS1x15

CircuitPython drivers for the ADS1x15 series of ADCs.
MIT License
140 stars 59 forks source link

More statistics to detect bad/over polling for fast continuous example #61

Closed WizardTim closed 3 years ago

WizardTim commented 3 years ago

Output with RATE=250

Old

$ python3 ads1x15_fast_read.py
Time of capture: 0.40527645900147036s
Sample rate requested=250 actual=2467.4514835226882

New

$ python3 ads1x15_fast_read.py
Took 0.408 s to acquire 1000 samples.

Configured:
    Requested       =   250    sps
    Reported        =   250    sps

Actual:
    Polling Rate    =  2448.00 sps
                        979.20%
    Repeats         =   901
    Conversion Rate =   242.35 sps   (estimated)
tannewt commented 3 years ago

(Looks like you'll need to run black over the new code.) https://learn.adafruit.com/improve-your-code-with-pylint

tannewt commented 3 years ago

Thanks again!