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);
}