dacWrite

dacWrite ( n1 n0 -- )

Write to DAC, n1=pin, n0=value [0..255]

The ESP32 features two 8-bit digital-to-analog converters (DACs), which makes it possible to produce a true analog signal, i.e. a voltage that can take any value between 0 and 3.3V.

Two pins can be used as analog output: GPIO 25 and GPIO 26.

For example, to set GPIO pin 25 to a value of 1 volt, you write:

25 77 dacWrite  \  77 * 3,3 / 255 = 1.