• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

DAC Not Working Correctly

Q&A Forum › Category: ESP32 › DAC Not Working Correctly
0 Vote Up Vote Down
David Hoagland asked 5 years ago

Hello,
I’m trying to get the DAC function to operate on my ESP32 and have used a number of different sketches. None work – the voltage on Pin 25 stays the same at around ~2.8v. I was hoping someone could help me troubleshoot the problem. Is this a common problem when outputting Analog voltages? I’m happy to send along my sketch if it would help, one copied below. any help appreciated.
Dave H
//DAC Output to control 600W Motor ESC
#define DACOut 25
void setup() {
// put your setup code here, to run once:
pinMode(DACOut, OUTPUT);
Serial.begin(115200);
}
void loop() {
// put your main code here, to run repeatedly:
for (int i = 0; i < 256; i++) {
dacWrite(DACOut, i);
delay(25);
}
for (int i = 255; i > 0; i–) {
dacWrite(DACOut, i);
delay(25);
}

Question Tags: DAC errors
1 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Hi David.
I tested your code, and it is working fine. I tested with my oscilloscope, see image below:

What ESP32 model are you using?
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.