Issue #048 [Fixed/closed] - Make the default reference Voltage for ADC´s configurable in the config file.

Posted by sandro@oehler.eu.org

What steps will reproduce the problem?

  1. Wrong Voltage for example MCP3008 connected to 5V reference. 2. 3. ...

WebIOPi version used? => 0.6.0

Python version used? => python3

Distro used? (WebIOPi has only been tested on Raspbian Wheezy) => Raspbian Wheezy

Raspberry Pi board revision? (1 or 2) => 2

For Javascript side bugs, Browser? =>

Please provide any additional information below.

I have am MCP3008 connected via I2C to my Raspberry Pi. As i have a different power Supply for this i connected everything to 5V. Well your Software is really great but i found out that the Voltage was shown false with 3.3 Volt maximum. I found out that this was hard coded in your Code. It would be cool if we could set this reference Voltage in the mail config file.


Comment 1

Posted by trouch

You right, I've kept this feature to later need. But you can use analogReadFloat instead of analogReadVolt. Simply multiply analogReadFloat with real VREF to get a voltage value. analogReadFloat is binded to REST API and Javascript lib too.


Comment 2

Posted by trouch


Comment 3

Posted by trouch


Comment 4

Posted by trouch


Comment 5

Posted by trouch

This issue was closed by revision r1440.


Comment 6

Posted by zopatista

You forgot to update the MCP4921 and MCP4922 subclasses in that file. See https://stackoverflow.com/questions/31761906/mcp4922-webiopi-doesnt-work