How to Disable DAC

kian79
Posts: 28
Joined: Thu Jun 13, 2019 3:27 am

How to Disable DAC

Postby kian79 » Fri Apr 24, 2020 10:58 am

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
}

chegewara
Posts: 2238
Joined: Wed Jun 14, 2017 9:00 pm

Re: How to Disable DAC

Postby chegewara » Fri Apr 24, 2020 4:56 pm

Code: Select all

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

Who is online

Users browsing this forum: Bing [Bot] and 55 guests