Oving4_4

Dependencies:   mbed

Revision:
1:e3039b96e3e9
Parent:
0:5071536b4cf6
--- 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;
 
     }
 }