I have the following code that I need to verify to read the MCP4725 board connected to the I2CAS1 on an arduino uno. I don’t know what the base I2c address is of the ADC since the marking on the chip says AJAR and that isn’t referenced in the manual for the chip.
This is the code segment I have:
//write to DAC
dac_output = 4000; //12 bit value
TWBR = 12; //400khz
Wire.beginTransmission(0x60); //default address
Wire.write(0x40); //write to the DAC
Wire.write(dac_output /16); //upper data bits
Wire.write((dac_output % 16) << 4);
Any thoughts on driving the DAC to a specific voltage?
ok so that works if I put that segment of code in the init and can change the DAC value on 0x60 using that code. However when I run that code in the loop, it won’t adjust the value of the DAC. Is there a delay I need to be considering?