The experiment using this program is introduced in "Interface" No.10, CQ publishing Co.,Ltd, 2014. 本プログラムを使った実験は,CQ出版社のインターフェース 2014年10月号で紹介しています.
Dependencies: DSProcessingIO mbed
AD_DA.cpp
- Committer:
- CQpub0Mikami
- Date:
- 2014-07-15
- Revision:
- 0:512bfb9310b2
- Child:
- 2:a6323b137ace
File content as of revision 0:512bfb9310b2:
//-------------------------------------------------------------- // Example for using Adc and Dac classes // Copyright (c) 2014 MIKAMI, Naoki, 2014/07/14 //-------------------------------------------------------------- #include "mbed.h" #include "AdcInternal.hpp" #include "MCP4922Single.hpp" using namespace Mikami; Adc adc_; Dac dacA_(Dac::DAC_A); Ticker timer_; void TimerIsr() { float value = adc_.Read(); // AD dacA_.Write(value); // DA } int main() { timer_.attach_us(&TimerIsr, 20); while (true) {} }