![](/media/cache/profiles/951e5e38cb91253e90bcae5ccd7baf3c.jpg.50x50_q85.jpg)
This example demonstrates how to use an DAC Audio output.
Intro
This example demonstrates how to use an DAC Audio output.
Parts
STM32 Nucleo F446RE |
Audio jack(TS or TRS) |
Register 10k, 4.7k |
Capacitor 0.01uF, 2.2uF |
Breadboard |
Wires |
Computer Speakers |
Wiring diagram
This circuit diagram was created by fritzing.
Revision 1:b018dbb87a88, committed 2016-03-10
- Comitter:
- beaglescout007
- Date:
- Thu Mar 10 16:19:20 2016 +0000
- Parent:
- 0:4df3adbe8435
- Commit message:
- Sine wave
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Mar 10 14:14:41 2016 +0000 +++ b/main.cpp Thu Mar 10 16:19:20 2016 +0000 @@ -20,7 +20,10 @@ int pos = tim.read_us() % period; // Square wave - dac = pos > (period / 2) ? 1 : 0; + //dac = pos > (period / 2) ? 1 : 0; + + // Sine wave + dac = sin(pos * 3.14f * 2 / period) / 2.0f + 0.5f; } int main()