Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-esp32
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-esp32
Commits
2884215f
Unverified
Commit
2884215f
authored
Feb 23, 2022
by
P-R-O-C-H-Y
Committed by
GitHub
Feb 23, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Documentation for DAC peripheral (#6337)
parent
a57cac63
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
+47
-0
docs/source/api/dac.rst
docs/source/api/dac.rst
+47
-0
No files found.
docs/source/api/dac.rst
0 → 100644
View file @
2884215f
###
DAC
###
About
-----
DAC (digital to analog converter) is a very common peripheral used to convert a digital signal to an
analog form.
ESP32 and ESP32-S2 have two 8-bit DAC channels. The DAC driver allows these channels to be set to arbitrary voltages.
DACs can be used for generating a specific (and dynamic) reference voltage for external sensors,
controlling transistors, etc.
========= ========= =========
ESP32 SoC DAC_1 pin DAC_2 pin
========= ========= =========
ESP32 GPIO 25 GPIO 26
ESP32-S2 GPIO 17 GPIO 18
========= ========= =========
Arduino-ESP32 DAC API
---------------------
dacWrite
********
This function is used to set the DAC value for a given pin/DAC channel.
.. code-block:: arduino
void dacWrite(uint8_t pin, uint8_t value);
* ``pin`` GPIO pin.
* ``value`` to be set. Range is 0 - 255 (equals 0V - 3.3V).
dacDisable
**********
This function is used to disable DAC output on a given pin/DAC channel.
.. code-block:: arduino
void dacDisable(uint8_t pin);
* ``pin`` GPIO pin.
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment