Lab1_Part9

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
bjs9
Date:
Wed Jan 31 17:56:24 2018 +0000
Commit message:
Lab1_Part9;

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 a0adc5ccd394 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Jan 31 17:56:24 2018 +0000
@@ -0,0 +1,22 @@
+#include "mbed.h"
+#include <math.h>
+ 
+#ifndef M_PI
+#define M_PI 3.1415
+#endif
+ 
+AnalogOut  aout(p18);
+float value = 0.0f;
+ 
+int main()
+{
+    const double pi = 3.141592653589793238462;
+    while (1) {
+        for(int i= 0; i < 20; i++ ){
+        aout = sin(pi  * i/10);
+        value = sin(pi * i/10);
+        printf("aout = %1.2f volts\n",aout.read());
+        wait(0.01);
+        }
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r a0adc5ccd394 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Jan 31 17:56:24 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/7130f322cb7e
\ No newline at end of file