ul-gh / PiPyADC

Python classes for interfacing Texas Instruments analog-to-digital converters with the Raspberry Pi
GNU Lesser General Public License v2.1
69 stars 27 forks source link

repeated cyclic sampling of channels #7

Closed asafosci closed 6 years ago

asafosci commented 6 years ago

First. thanks for the code. its great !

I need to read 4 analog channels of the adc 10 times per second. When I try to use read_sequence it performs around 5 times/sec and i was unable to change this rate. is this the max rate it is capable of. i played with drate to no avail. What is the right way to do so (i want to read an analog sensor 10-100 times per second) ?

ul-gh commented 6 years ago

Hi, on a Raspberry Pi, max. sampling rate should be more close to 1000 samples per second, depending on your hardware and kernel version.

If you only get 5 samples per second, the reason is most likely that you set the data rate to just this value, see:

https://github.com/ul-gh/PiPyADC/blob/master/ADS1256_default_config.py#L83

HTH, Ulrich

asafosci commented 6 years ago

you were right. thank you :-)