CCCPaste

9b4afc0e625d3

// Code Example - Arduino Nano Wiring 
// SDA → A4    SCL → A5
// VCC → 5V    GND → GND
// This toggles the DAC output between 0V and ~2.5V every second. The value 2048 is half 
// of the 12-bit max (4095), giving half the supply voltage.

#include 
#include 

Adafruit_MCP4725 dac;

void setup() {
  dac.begin(0x62);
}

void loop() {
  dac.setVoltage(2048, false);
  delay(1000);
  dac.setVoltage(0, false);
  delay(1000);
}