by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"

Dependencies:   mbed

Revision:
0:9ba494009efb
--- /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;
+}
+