Page 1 of 1

How to Disable DAC

Posted: Fri Apr 24, 2020 10:58 am
by kian79
Hi all,

I need to use IO25 as a digital output pin, but it seems like it is a DAC output by default.

How do I disable DAC function? I tried the following code but its not working:

#include <driver/dac.h>

// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
dac_output_disable(DAC_CHANNEL_1);
pinMode(25, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(25, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(25, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}

Re: How to Disable DAC

Posted: Fri Apr 24, 2020 4:56 pm
by chegewara

Code: Select all

pinMode(25, OUTPUT);
This is all you need, nothing more.