File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change 1+ ###
2+ DAC
3+ ###
4+
5+ About
6+ -----
7+
8+ DAC (digital to analog converter) is a very common peripheral used to convert a digital signal to an
9+ analog form.
10+
11+ ESP32 and ESP32-S2 have two 8-bit DAC channels. The DAC driver allows these channels to be set to arbitrary voltages.
12+
13+ DACs can be used for generating a specific (and dynamic) reference voltage for external sensors,
14+ controlling transistors, etc.
15+
16+ ========= ========= =========
17+ ESP32 SoC DAC_1 pin DAC_2 pin
18+ ========= ========= =========
19+ ESP32 GPIO 25 GPIO 26
20+ ESP32-S2 GPIO 17 GPIO 18
21+ ========= ========= =========
22+
23+ Arduino-ESP32 DAC API
24+ ---------------------
25+
26+ dacWrite
27+ ********
28+
29+ This function is used to set the DAC value for a given pin/DAC channel.
30+
31+ .. code-block :: arduino
32+
33+ void dacWrite(uint8_t pin, uint8_t value);
34+
35+ * ``pin `` GPIO pin.
36+ * ``value `` to be set. Range is 0 - 255 (equals 0V - 3.3V).
37+
38+ dacDisable
39+ **********
40+
41+ This function is used to disable DAC output on a given pin/DAC channel.
42+
43+ .. code-block :: arduino
44+
45+ void dacDisable(uint8_t pin);
46+
47+ * ``pin `` GPIO pin.
You can’t perform that action at this time.
0 commit comments