![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Sin generator using 2nd-ordered IIR filter for ST Nucleo F401RE.
Diff: main.cpp
- Revision:
- 4:9b973a35d1e5
- Parent:
- 2:799a843be414
--- a/main.cpp Mon Nov 10 10:02:27 2014 +0000 +++ b/main.cpp Wed Nov 12 10:46:48 2014 +0000 @@ -1,14 +1,13 @@ //-------------------------------------------------------------- // Sin generator using IIR filter // Analog Output: MCP4922 using SPI -// 2014/10/23, Copyright (c) 2014 MIKAMI, Naoki +// 2014/11/12, Copyright (c) 2014 MIKAMI, Naoki //-------------------------------------------------------------- #include "mbed.h" #include "ADC_Base.hpp" // for ADC not using interrupt #include "DAC_MCP4922.hpp" // for DAC MCP4922 -#include "ScfClockTim3.hpp" // for clock supplied to SCF using namespace Mikami; @@ -23,7 +22,7 @@ const float A1 = 2.0f*cosf(PI2*F0/(float)FS_); const float B1 = 0.8f*sinf(PI2*F0/(float)FS_); - ScfClockTim3(500000); // cutoff frequency: 5 kHz + myDac_.ScfClockTim3(500000); // cutoff frequency: 5 kHz float yn1 = B1; float yn2 = 0;