Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python-AD770X #1

Open
hooman-sarv opened this issue Jan 22, 2021 · 2 comments
Open

python-AD770X #1

hooman-sarv opened this issue Jan 22, 2021 · 2 comments

Comments

@hooman-sarv
Copy link

HI. I have a question.

where do you use\call function. you dont use it anywhere. please help me.

def readVoltage(self,channel,vref,factor=1) :
return float(self.readADResultRaw(channel)) / 65536.0 * vref * factor

@belese
Copy link
Owner

belese commented Jan 22, 2021

It's a long time ago,
it's only useful to read voltage value, you can call it in your code to have raw value converted to real voltage.
you call this with your vref, and it translate to real voltage.
Factor is you had difference Betwwen read voltage and measured voltage, you can add this as factor.

If you don't read a voltage value, you do'nt need it.

@hooman-sarv
Copy link
Author

hooman-sarv commented Jan 24, 2021

thanks a lot.
I use it like this

def readADResultRaw(self,channel) :
while not self.dataReady(channel) :
pass
self.setNextOperation(REG_DATA, channel, 1)

return self.readVoltage(channel,vref,1);

but my program Stuck in an Infinite Loop and then crash.

How can I use it??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants