Hello,
I started working on a project and for it I need a DAC to implement it. I wanted to get a basic program running using the DAC but I have not been able to. I have the output of the DAC connected to a 5k resistor and I am measuring the voltage across that resistor and I always get ~3.3V.
int led = D7;
void setup() {
pinMode(DAC1, OUTPUT);
pinMode(D7, OUTPUT);
digitalWrite(led, LOW);
}
void loop()
{
pinMode(DAC1, OUTPUT);
analogWrite(DAC1, 4095);
digitalWrite(led, HIGH);
delay(5000);
pinMode(DAC1, OUTPUT);
analogWrite(DAC1, 0);
digitalWrite(led, LOW);
delay(5000);
}