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