Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: main.cpp
- 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