Skip to content

reading a single channel's  #6

@olivierausseil

Description

@olivierausseil

Hi,
Thanks for your work.

I have a question because i can't explain why.

I use your exemple and add just a loop while when i reading the value.

import ads1256                                   # import this lib
ads1256.start(str(1),"25")                       # initialize the ADC using 25 SPS with GAIN of 1x
i = True
while i :
  ChannelValue = ads1256.read_channel(7)           # read the value from ADC channel 0
  print str(ChannelValue * 0.000596) + " mV"                 # print the value from the variable (mV)
ads1256.stop()

It works but i have the same value 8 times :

19.049352 mV
19.049352 mV
19.049352 mV
19.049352 mV
19.049352 mV
19.049352 mV
19.049352 mV
19.049352 mV

19.044584 mV
19.044584 mV
19.044584 mV
19.044584 mV
19.044584 mV
19.044584 mV
19.044584 mV
19.044584 mV
19.075576 mV
19.075576 mV
19.075576 mV
19.075576 mV
19.075576 mV
19.075576 mV
19.075576 mV
19.075576 mV

18.998096 mV
18.998096 mV
18.998096 mV
18.998096 mV
18.998096 mV
18.998096 mV
18.998096 mV
18.998096 mV

Maybe is not possible or i do something wrong.
I want do a measurement in volt for after calculate a current. I would like to measure every X ms but suddenly I can not.

Thanks in advance
Olivier

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions