The experiment using this program is introduced in "Interface" No.10, CQ publishing Co.,Ltd, 2014. 本プログラムを使った実験は,CQ出版社のインターフェース 2014年10月号で紹介しています.
Dependencies: DSProcessingIO mbed
Diff: AD_DA.cpp
- Revision:
- 0:512bfb9310b2
- Child:
- 2:a6323b137ace
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/AD_DA.cpp Tue Jul 15 08:05:58 2014 +0000 @@ -0,0 +1,26 @@ +//-------------------------------------------------------------- +// 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) {} +}