![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Prototype program of AD and DA using classes in UIT_ADDA. This program does not use interrupt of ADC for ST Nucleo F401RE. UIT_ADDA のクラスを使った AD および DA のためのプログラムの雛形.ADC の割り込みは使わないバージョン.ST Nucleo F401 用.
Dependencies: UIT_ACM1602NI UIT_ADDA mbed
main.cpp
- Committer:
- MikamiUitOpen
- Date:
- 2014-10-20
- Revision:
- 0:fa5a90c45188
- Child:
- 1:b4af5a0ad127
File content as of revision 0:fa5a90c45188:
//-------------------------------------------------------------- // 割り込みを使わずに AD DA を行う場合の雛形 // Analog Input : A0 // Analog Output: MCP4922 using SPI // 2014/10/20, Copyright (c) 2014 MIKAMI, Naoki //-------------------------------------------------------------- #include "mbed.h" #include "ADC_Interrupt.hpp" // for ADC using interrupt #include "DAC_MCP4922.hpp" // for DAC MCP4922 #include "ScfClockTim3.hpp" // for clock supplied to SCF #include "ACM1602NI.hpp" // for LCD display using namespace Mikami; const int FS_ = 10000; // Sampling frequency: 24 kHz ADC_Base adc_(A0, FS_); // for AD DAC_MCP4922 myDac_(DAC_MCP4922::DAC_A); // for DA int main() { ScfClockTim3(420000); // cutoff frequency: 4.2 kHz while (true) { float xn = adc_.Read(); // Read from A0 //----------------------------------------------- // Put signal processing program here //----------------------------------------------- myDac_.Write(xn); // Write to DAC } }