Skip to content

Commit 2914e25

Browse files
committed
Update dac.md
1 parent 868af45 commit 2914e25

File tree

1 file changed

+7
-7
lines changed
  • content/hardware/02.hero/boards/uno-r4-wifi/tutorials/dac

1 file changed

+7
-7
lines changed

content/hardware/02.hero/boards/uno-r4-wifi/tutorials/dac/dac.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@ In this article, you will learn:
2525
- how to generate a waveform (sawtooth),
2626
- how to output this waveform on a piezo speaker.
2727

28-
### Analog Output VS. 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).
30-
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.
32-
33-
However this will not always be the case, and for many uses you will need to use a genuine analog output to get your desired results. One such case is in audio purposes, where a PWM output simply will not give the same quality of sound as a genuine analog output, and requires some fiddling to work in the first place.
34-
3528
## Hardware & Software Needed
3629
To follow along with this article, you will need the following hardware:
3730

@@ -45,6 +38,13 @@ The circuit required for this tutorial can be found in the diagram below:
4538

4639
![Piezo buzzer connected to UNO R4](./assets/circuit.png)
4740

41+
## Analog Output VS. PWM
42+
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).
43+
44+
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.
45+
46+
However this will not always be the case, and for many uses you will need to use a genuine analog output to get your desired results. One such case is in audio purposes, where a PWM output simply will not give the same quality of sound as a genuine analog output, and requires some fiddling to work in the first place.
47+
4848
## Code
4949
The code for this tutorial is split in two part, one main sketch and a header file containing a pre-generated sawtooth-waveform.
5050

0 commit comments

Comments
 (0)