Datasheet
Arduino Code
Next up, download the Adafruit MCP4725 library. This library does all of the interfacing, so you can just "set and forget"
the DAC output. It also has some examples to get you started
The library is available on GitHub. You can download it by clicking the button below.
Download Adafruit_MCP4725 Library
https://adafru.it/cDA
Rename the uncompressed folder Adafruit_MCP4725. Check that the Adafruit_MCP4725 folder
contains Adafruit_MCP4725.cpp and Adafruit_MCP4725.h
Place the Adafruit_MCP4725 library folder your
sketchbookfolder
/libraries/ folder. You may need to create the
libraries subfolder if its your first library. You can figure out your
sketchbookfolder
by opening up the Preferences tab
in the Arduino IDE.
Restart the IDE.
Open up the File→Examples→Adafruit_MCP4725→trianglewave sketch and upload it to the Arduino. Then connect
your oscilloscope (or an LED + resistor if you don't have access to an oscilloscope)
We also have a sine wave version showing how to use a lookup table to create a more complex waveform.
Using the library
The library is very simple, so you can adapt it very quickly.
© Adafruit Industries https://learn.adafruit.com/mcp4725-12-bit-dac-tutorial Page 7 of 14