ISISA-Zacatenco / Mbed 2 deprecated Create_sound_tiker

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Javierdf
Date:
Sun Sep 22 03:08:12 2019 +0000
Commit message:
creat soun tiker

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
--- /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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Sep 22 03:08:12 2019 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/fb8e0ae1cceb
\ No newline at end of file