i want to convert an external digital signal using DAC1 in Due. i wrote the code to do this function but there is no analog signal in the analog output in pin DAC1.
const int InputDigitalPin = 24;// digital input pin 24
analogWriteResolution(12); // 12 bits resolution
pinMode(InputDigitalPin,INPUT); // assigned pin 24 as input
b = digitalRead(24);// read digital pin 24 and put it in varible b
analogWrite(DAC1, b); // output analog signal on pin DAC1
i am sure i am missing something, could anyone help me out and tell me what modification i should do in the sketch?