Oving4_4

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
olemh88
Date:
Tue Sep 19 12:44:13 2017 +0000
Parent:
0:5071536b4cf6
Commit message:
?ving4_4

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 5071536b4cf6 -r e3039b96e3e9 main.cpp
--- a/main.cpp	Tue Sep 19 12:08:40 2017 +0000
+++ b/main.cpp	Tue Sep 19 12:44:13 2017 +0000
@@ -8,26 +8,23 @@
 Ticker tick2;
 Ticker tick3;
 Ticker tick4;
+volatile int xx, yy, zz, ee;
 
 void x()
 {
-    Led1 = 1;
-    tick1.detach();
+    xx = !xx;
 }
 void y()
 {
-    Led2 = 1;
-    tick2.detach();
+    yy = !yy;
 }
 void z()
 {
-    Led3 = 1;
-    tick3.detach();
+    zz = !zz;
 }
 void e()
 {
-    Led4 = 1;
-    tick4.detach();
+    ee = !ee;
 }
 int main()
 {
@@ -36,6 +33,10 @@
     tick3.attach(&z, 0.14);
     tick4.attach(&e, 0.1);
     while(1) {
+        Led1 = xx;
+        Led2 = yy;
+        Led3 = zz;
+        Led4 = ee;
 
     }
 }