Hi
I am programming a I2C to read ADC input but I am having some problems accessing the internal registers in sequence. Can anyone offer some insights?
Thank you.
ADC: LTC2497 Datasheet and Product Info | Analog Devices
#include <SPI.h>
#include <Wire.h>
#define ADCAddr 0x14 //Address of I2C
#define ADCChan 0xB0 //Channel of IC
int data, data2;
void setup() {
Wire.begin();
//Start I2C Communication
Wire.beginTransmission(ADCAddr);
Wire.write(1);
Wire.endTransmission(true);
Serial.begin(9600);
Serial.println("Welcome to BMS");
}
void loop() {
Wire.beginTransmission(ADCAddr);
Wire.write(ADCChan);
Wire.requestFrom(ADCAddr, 3); //Request data from the I2C Address and # of byte, max 3
while(Wire.available()) {
data = Wire.read(); //Request data from the IC
data2 = Wire.read(); //Subsequent internal register address
Serial.println(data);
Serial.println(data2);
}
}