mcp4725 Use Code
mcp4725 Use Code
//This is the I2C Address of the MCP4725, by default (A0 pulled to GND).
//Please note that this breakout is for the MCP4725A0.
#define MCP4725_ADDR 0x60
//For devices with A0 pulled HIGH, use 0x61
int sintab2[512] =
{
2048, 2073, 2098, 2123, 2148, 2174, 2199, 2224 };
void setup()
{
Wire.begin();
Applications
Sensor Calibration
PC Peripherals
Data Acquisition Systems
Low Power Portable Instrumentation
MCP4725 Arduino connection
Here is an example code for the MCP4725 with the Arduino. You will
need to install the Adafruit_MCP4725.h library so downlaod it from
below. It will be a.zip file. In Arduino IDE, go to include library as .zip
file and select the downlaoded file. Now the library shoudl work.
Compile, make the connections and uplaod the code.
Download Adafruit_MCP4725.h
Adafruit_MCP4725 MCP4725;
void setup(void) {
Serial.begin(9600);
MCP4725.begin(0x60); // Default I2C Address of MCP4725 breakout board (sparkfun)
If not try 0x61 or 0x62
void loop(void) {
uint32_t MCP4725_value;
int adcValueRead = 0;
float voltageRead = 0;
float MCP4725_expected_output;