by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"
Dependencies: mbed
Fork of PE_11-01_DSPInOut by
Revision 0:9ba494009efb, committed 2013-06-16
- Comitter:
- robt
- Date:
- Sun Jun 16 15:18:06 2013 +0000
- Child:
- 1:92e81744d2f8
- Commit message:
- by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"
Changed in this revision
main.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/main.cpp Sun Jun 16 15:18:06 2013 +0000 @@ -0,0 +1,25 @@ +/* Program Example 11.1 DSP input and Output + */ +#include "mbed.h" +//mbed objects +AnalogIn Ain(p15); +AnalogOut Aout(p18); +Ticker s20khz_tick; + +//function prototypes +void s20khz_task(void); +//variables and data +float data_in, data_out; + +//main program start here +int main() { + s20khz_tick.attach_us(&s20khz_task,50); //attach task to 50us tick +} + +// function 20khz_task +void s20khz_task(void){ + data_in=Ain; + data_out=data_in; + Aout=data_out; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Jun 16 15:18:06 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/b3110cd2dd17 \ No newline at end of file