Juan Angel García
/
11_1
DSP simple
Revision 0:43c022a9dd55, committed 2017-03-09
- Comitter:
- jangelgm
- Date:
- Thu Mar 09 21:52:42 2017 +0000
- Commit message:
- DSP simple
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 |
diff -r 000000000000 -r 43c022a9dd55 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Mar 09 21:52:42 2017 +0000 @@ -0,0 +1,30 @@ +/* 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 (20khz) +} + +// function 20khz_task. Para realizar un muestreo a intervalos de 50us +void s20khz_task(void) +{ + data_in=Ain; + data_out=data_in; + Aout=data_out; +} \ No newline at end of file
diff -r 000000000000 -r 43c022a9dd55 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Mar 09 21:52:42 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/6c34061e7c34 \ No newline at end of file