The experiment using this program was planned to be introduced on and after "Interface" No.11, CQ publishing Co.,Ltd, 2014. 本プログラムを使った実験は,CQ出版社のインターフェース 2014年11月号以降で紹介する予定でした.
Revision 0:07aed8c7ef5e, committed 2014-07-15
- Comitter:
- CQpub0Mikami
- Date:
- Tue Jul 15 07:50:56 2014 +0000
- Commit message:
- 1
Changed in this revision
Ticker_10kHz.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Ticker_10kHz.cpp Tue Jul 15 07:50:56 2014 +0000 @@ -0,0 +1,27 @@ +//-------------------------------------------------------- +// Rectangular wave generator using Ticker class +// frequency : 10 kHz +// output : D8 pin +// Copyright (c) 2014 MIKAMI, Naoki, 2014/07/14 +//-------------------------------------------------------- + +#include "mbed.h" + +Ticker timer_; +DigitalOut pinOut_(D8); + +int flip_ = 0; + +void TimerIsr() +{ + pinOut_.write(flip_); +// pinOut = flip_; + flip_ = !flip_; +} + +int main() +{ + // interval: 50 micro seconds + timer_.attach_us(&TimerIsr, 50); + while(true) {} +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Jul 15 07:50:56 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/04dd9b1680ae \ No newline at end of file