Closed Kakalos14 closed 2 years ago
Hi,
if you look at line 160, this is a numpy array that can be indexed just like any Python list object:
ch0 = ch_volts[0]
ch1 = ch_volts[1] ...
Writing this to a file, every second (you can append or overwrite each time):
with open("demofile2.txt", "a") as file:
text = f"Channel 1 volts reading is: {ch_volts[0]}"
file.write(text)
file.close()
https://www.w3schools.com/python/python_file_write.asp https://www.pythonforbeginners.com/files/reading-and-writing-files-in-python
Btw: No, you can not read 10000 samples every second. See: https://github.com/ul-gh/PiPyADC/issues/27#issuecomment-773673952
As far as it concerns the example_2.py. Could you please show me a way in which I could access the samples of the buffer for each channel and write them in a file? For example I'd like to take 10000 samples of a single channel every second and write them to a file. I work on theTexas Instrument ADS1256 ADC that has a hardware buffer. Thank you in advance!