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

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
robt
Date:
Sun Jun 16 15:18:06 2013 +0000
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
diff -r 000000000000 -r 9ba494009efb main.cpp
--- /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;
+}
+
diff -r 000000000000 -r 9ba494009efb mbed.bld
--- /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