ISISA-Zacatenco / Mbed 2 deprecated Create_sound_tiker

Dependencies:   mbed

Revision:
0:e507ed1402e5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Sep 22 03:08:12 2019 +0000
@@ -0,0 +1,39 @@
+#include "mbed.h"
+
+Ticker flipper;
+Serial pc(USBTX,USBRX);
+AnalogIn a1(A0);
+DigitalOut hz(D2);
+int y;
+
+void tono_on()
+{
+ if(y>100)
+ {
+  hz=1; 
+  
+ } 
+ else hz=0; 
+}
+/*void tono_off()
+{
+ if(y>100)
+ {
+  hz=0;  
+ }  
+}*/
+    
+
+int main()
+{
+    flipper.attach(&tono_on,0.001 );
+    
+    while (true)
+     {
+      y=270*a1.read(); 
+      //flipper.attach(&tono_on,0.01 );
+      //flipper.attach(&tono_off,0.001 );
+      pc.printf("%d\n",y);
+             
+    }
+}
\ No newline at end of file