The line:
return (reading/65536.0)*voltage;shouldn't that be:
return (reading/3.3)*voltage;?
The line:
return (reading/65536.0)*voltage;shouldn't that be:
return (reading/3.3)*voltage;?
Did you try it? I think that’s right. The value “reading” will be between 0 and 65535, so you need to scale it to turn it into a voltage.
Peter