Reading adcmcp3428 using Arduino getting error

Hello guys ,
I am trying to read analog values using MCP3428 and displaying in the form of voltage but getting only 0.00 value instead of actual voltage.I have checked with multimeter at channel mcp3428 getting voltage but at output it sending value 0.00.

here is my program

#include <MCP3428.h>
#include <Wire.h>

MCP3428 MCP(0); 

void setup()
{
   
    Serial.begin(9600);
    Serial.println("MCP3428 Analog to Digital Converter");
    Serial.println("Getting ADC Readings from Channel 1");
    Serial.println("        ************************************            ");
    Serial.println("        ");
    delay(500);
}

void loop()
{
    byte error;
    int8_t address = 0x6E;

    address = MCP.devAddr;
    Wire.beginTransmission(0x6E);
    error = Wire.endTransmission();
    if (error == 0)
    {
        long Raw_adc;

        MCP.SetConfiguration(1,14,1,1);

        Raw_adc = MCP.readADC();
        float Voltage = Raw_adc*0.00034; //( to read 0-10V DC)
       

        Serial.print("Digital value at Channel 1: ");
        Serial.println(Voltage);
    }
    else
    {
        Serial.println("MCP3428 Disconnected!");
    }

    delay(1000);
}


Tell me where i'm going wrong i'm not getting proper output in the form of voltage

uint8_t address = MCP.devAddr;

Are you sure that should not be:
MCP3428 MCP(0x6E);


i tried with this changes but getting this errors.
Redeclaration error of variable.
conflicting declaration error.

Hello sir ,
I am not sure about that but i tried both the way with
MCP3428 MCP(0x6E);
MCP3428 MCP(0);

but no any change in result.

Are you sure your ADC is at address 0x6E? The library defaults to 0x68.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.