// 25 & 26 DAC pinout
//https://www.upesy.com/cdn/shop/files/doc-esp32-pinout-reference-wroom-devkit.png?width=1038

#define DACPin  25

void setup() {
  
  Serial.begin(115200);

}

void loop() {

  // DAC 8-bit: max 255, min 0
  int dacVal = 255;

  //write value to DAC output
  //255: 3.3V
  //0: 0 V
  //out_voltage = 3.3 * dacVal / 255
  //https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/peripherals/dac.html
  dacWrite(DACPin, dacVal); 

  Serial.printf("DAC Val: %d\n", dacVal);

  delay(100);
}