An example program driving the AnalogOut. Connect a pair of earphones!

Dependencies:   mbed

Fork of app-board-AnalogOut by Chris Styles

Revision:
2:1b650317539d
Parent:
1:754db1ff50f2
--- a/main.cpp	Tue Jun 18 11:15:37 2013 +0000
+++ b/main.cpp	Mon May 05 14:53:03 2014 +0000
@@ -1,14 +1,21 @@
 #include "mbed.h"
 
 AnalogOut Aout(p18);
-AnalogIn pot1(p19);
+//AnalogIn pot1(p19);
+int i = 0;
 
 int main()
 {
     while(1) {
-        for(float i=0.0; i<1.0; i+=0.1) {
+       // for(float i=0.0; i<1.0; i+=0.01) {
+          
+          if(i==1) 
+          {
+            i=0.0;
+          }
+            else i=1;
             Aout = i;
-            wait(0.00001+(0.0001*pot1.read()));
-        }
+            wait(0.000001);
+        
     }
 }