docs/esp32/quickref: Add DAC example.
Signed-off-by: IhorNehrutsa <Ihor.Nehrutsa@gmail.com>
This commit is contained in:
parent
495be71d56
commit
e423b3c0ba
|
@ -330,6 +330,19 @@ possible at the same frequency.
|
||||||
|
|
||||||
See more examples in the :ref:`esp32_pwm` tutorial.
|
See more examples in the :ref:`esp32_pwm` tutorial.
|
||||||
|
|
||||||
|
DAC (digital to analog conversion)
|
||||||
|
----------------------------------
|
||||||
|
|
||||||
|
On the ESP32, DAC functionality is available on pins 25, 26.
|
||||||
|
On the ESP32S2, DAC functionality is available on pins 17, 18.
|
||||||
|
|
||||||
|
Use the DAC::
|
||||||
|
|
||||||
|
from machine import DAC, Pin
|
||||||
|
|
||||||
|
dac = DAC(Pin(25)) # create an DAC object acting on a pin
|
||||||
|
dac.write(128) # set a raw analog value in the range 0-255, 50% now
|
||||||
|
|
||||||
ADC (analog to digital conversion)
|
ADC (analog to digital conversion)
|
||||||
----------------------------------
|
----------------------------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue