You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/hardware/02.hero/boards/uno-r4-wifi/tutorials/dac/dac.md
+8-6Lines changed: 8 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -14,17 +14,19 @@ software:
14
14
- web-editor
15
15
---
16
16
17
-
***NOTE: As both the Arduino UNO R4 Minima and the Arduino UNO R4 WiFi has a DAC, this feature works identically on both versions of the board. This means that you can follow along with this tutorial regardless of what version of the board you have in front of you.***
18
17
19
-
The Arduino UNO R4 has a built in **DAC** (Digital to Analog Converter) which means that it natively supports analog output. This feature can be used to build a plethora of fun audio projects, but also work as professional lab equipment as a cheap function generator, for example.
18
+
The Arduino UNO R4 WiFi has a built in **DAC** (Digital to Analog Converter) which is used to transform a digital signal to an analog one. This feature can be used to build a plethora of fun audio projects, but also work as professional lab equipment as a cheap function generator, for example.
20
19
21
20
## Goals
22
-
By following along with this article, you will learn how to use the DAC features of the UNO R4 WiFi boards to generate waveforms, either to make sound or to generate functions, in ways that cannot be done with PWM.
23
21
24
-
We will go over the difference between PWM and analog output, and we'll apply these learnings in a quick project where we
22
+
In this article, you will learn:
23
+
- About the DAC feature onboard the UNO R4 WiFi,
24
+
- differences between PWM and DAC techniques,
25
+
- how to generate a waveform (sawtooth),
26
+
- how to output this waveform on a piezo speaker.
25
27
26
28
### Analog Output VS. PWM
27
-
For many use cases when analog output is required, using PWM (Pulse Width Modulation) instead of genuine analog output will yield essentially the same results. A digital output pin can only either be fully on (HIGH) or fully off (LOW), but by turning on and off very quickly with precise timings, the average voltage can be controlled and emulate an analog output, this method is called PWM.
29
+
For many use cases when analog output is required, using PWM (Pulse Width Modulation) instead of genuine analog output will yield essentially the same results. A digital output pin can only either be fully on (HIGH) or fully off (LOW), but by turning on and off very quickly with precise timings, the average voltage can be controlled and emulate an analog output. This method is called [PWM](/learn/microcontrollers/analog-output).
28
30
29
31
For example when dimming an LED, you can freely use a PWM enabled digital pin as an analog output pin and the LED would dim just the same as if you'd be using a DAC output.
30
32
@@ -33,7 +35,7 @@ However this will not always be the case, and for many uses you will need to use
33
35
## Hardware & Software Needed
34
36
To follow along with this article, you will need the following hardware:
35
37
36
-
- Arduino UNO R4 Minima or Arduino UNO R4 WiFi
38
+
-[Arduino UNO R4 WiFi](https://store.arduino.cc/products/arduino-uno-r4-wifi)
0 commit comments