Code 5: //The demo code is DAC You can copy the code to your Arduino IDE
Code:
#define DAC1 26 //DAC1 IO26
//#define DAC2 25 //DAC2 IO25
void setup() {
}
void loop() {
int Value = 127; //255= 10V
dacWrite(DAC1, 1);
delay(500);
dacWrite(DAC1, 50);
delay(500);
dacWrite(DAC1, 100);
delay(500);
dacWrite(DAC1, 150);
delay(500);
dacWrite(DAC1, 255);
delay(500);
}